ConceptPortal-public/rsconcept/frontend/src/components/info/InfoUsers.tsx

27 lines
725 B
TypeScript
Raw Normal View History

2024-05-27 20:42:34 +03:00
import clsx from 'clsx';
import { useUsers } from '@/context/UsersContext';
import { UserID } from '@/models/user';
import { CProps } from '../props';
interface InfoUsersProps extends CProps.Styling {
items: UserID[];
prefix: string;
}
function InfoUsers({ items, className, prefix, ...restProps }: InfoUsersProps) {
const { getUserLabel } = useUsers();
return (
<div className={clsx('flex flex-col dense', className)} {...restProps}>
{items.map((user, index) => (
<div key={`${prefix}${index}`}>{getUserLabel(user)}</div>
))}
2024-08-21 21:36:29 +03:00
{items.length === 0 ? <div className='text-center'>Пользователи не выбраны</div> : null}
2024-05-27 20:42:34 +03:00
</div>
);
}
export default InfoUsers;