import React, { forwardRef } from "react"; import { IconCheck, IconChevronDown } from "@tabler/icons-react"; import { Group, Text, Menu, Button } from "@mantine/core"; import { IRoleData } from "@/lib/types.ts"; import { useTranslation } from "react-i18next"; interface RoleButtonProps extends React.ComponentPropsWithoutRef<"button"> { name: string; } const RoleButton = forwardRef( ({ name, ...others }: RoleButtonProps, ref) => ( ), ); interface RoleMenuProps { roles: IRoleData[]; roleName: string; onChange?: (value: string) => void; disabled?: boolean; } export default function RoleSelectMenu({ roles, roleName, onChange, disabled, }: RoleMenuProps) { const { t } = useTranslation(); return ( {roles?.map((item) => ( onChange && onChange(item.value)} key={item.value} >
{t(item.label)} {t(item.description)}
{item.label === roleName && }
))}
); }