ConceptPortal-public/rsconcept/frontend/src/features/users/components/info-users.tsx
Ivan 91186b0e2e
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
Frontend CI / notify-failure (push) Blocked by required conditions
R: Replace clsx with merging styles
2025-06-24 22:23:27 +03:00

24 lines
762 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { type Styling } from '@/components/props';
import { cn } from '@/components/utils';
import { useLabelUser } from '../backend/use-label-user';
interface InfoUsersProps extends Styling {
items: number[];
prefix: string;
header?: string;
}
export function InfoUsers({ items, className, prefix, header, ...restProps }: InfoUsersProps) {
const getUserLabel = useLabelUser();
return (
<div className={cn('flex flex-col dense', className)} {...restProps}>
{header ? <h2>{header}</h2> : null}
{items.map((user, index) => (
<div key={`${prefix}${index}`}>{getUserLabel(user)}</div>
))}
{items.length === 0 ? <div className='text-center'>Пользователи не выбраны</div> : null}
</div>
);
}