2025-02-23 16:54:11 +03:00
|
|
|
import { UserRole } from '@/features/users';
|
|
|
|
|
2025-06-18 16:14:41 +03:00
|
|
|
import { type DomIconProps, IconAdmin, IconEditor, IconOwner, IconReader } from '@/components/icons';
|
2025-02-23 16:54:11 +03:00
|
|
|
|
2025-06-18 16:14:41 +03:00
|
|
|
export function IconRole({ value, size = '1.25rem', className }: DomIconProps<UserRole>) {
|
|
|
|
switch (value) {
|
2025-02-23 16:54:11 +03:00
|
|
|
case UserRole.ADMIN:
|
2025-06-18 16:14:41 +03:00
|
|
|
return <IconAdmin size={size} className={className ?? 'icon-primary'} />;
|
2025-02-23 16:54:11 +03:00
|
|
|
case UserRole.OWNER:
|
2025-06-18 16:14:41 +03:00
|
|
|
return <IconOwner size={size} className={className ?? 'icon-primary'} />;
|
2025-02-23 16:54:11 +03:00
|
|
|
case UserRole.EDITOR:
|
2025-06-18 16:14:41 +03:00
|
|
|
return <IconEditor size={size} className={className ?? 'icon-primary'} />;
|
2025-02-23 16:54:11 +03:00
|
|
|
case UserRole.READER:
|
2025-06-18 16:14:41 +03:00
|
|
|
return <IconReader size={size} className={className ?? 'icon-primary'} />;
|
2025-02-23 16:54:11 +03:00
|
|
|
}
|
|
|
|
}
|