import { useQuery } from "@tanstack/react-query"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@common/components"; import { RoleApi } from "@/entities/role"; import { ENDPOINT } from "@/shared/config"; type RoleSelectProps = React.ComponentPropsWithoutRef & { mngrYn?: string; }; function RoleSelect({ mngrYn = "N", ...props }: RoleSelectProps) { const { data: roles } = useQuery({ queryKey: [ENDPOINT.USER_SERVICE.ROLES], queryFn: () => RoleApi.getRoles({ keywordType: "useYn", keyword: "Y", page: 0, size: 100, }), }); const options = roles?.content.filter((role) => role.mngrYn === mngrYn); return ( ); } export { RoleSelect };