ConceptPortal-public/rsconcept/frontend/src/features/users/components/info-users.tsx

24 lines
762 B
TypeScript
Raw Normal View History

import { type Styling } from '@/components/props';
2025-06-24 22:23:27 +03:00
import { cn } from '@/components/utils';
2025-03-12 11:55:43 +03:00
import { useLabelUser } from '../backend/use-label-user';
2024-05-27 20:42:34 +03:00
interface InfoUsersProps extends Styling {
2025-02-17 15:12:15 +03:00
items: number[];
2024-05-27 20:42:34 +03:00
prefix: string;
2024-10-30 21:48:17 +03:00
header?: string;
2024-05-27 20:42:34 +03:00
}
export function InfoUsers({ items, className, prefix, header, ...restProps }: InfoUsersProps) {
const getUserLabel = useLabelUser();
2024-05-27 20:42:34 +03:00
return (
2025-06-24 22:23:27 +03:00
<div className={cn('flex flex-col dense', className)} {...restProps}>
2024-10-30 21:48:17 +03:00
{header ? <h2>{header}</h2> : null}
2024-05-27 20:42:34 +03:00
{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>
);
}