Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 122x 43x 43x 48x 43x 126x 122x | import { RHFSelect } from "@common/Select";
import { useAppSelector } from "@redux/hooks";
import { useGetLegalEntitiesTypes } from "@services/api/merchants";
type BusinessTypeSelectProps = {
name: string;
label: string;
disabled?: boolean;
};
const BusinessTypeSelect = ({
name,
label,
disabled,
}: BusinessTypeSelectProps) => {
const { data, isFetching, isError } = useGetLegalEntitiesTypes();
const hasNotLETypesPermission = useAppSelector(
(state) => state.app.permissions?.get_legal_entities_types,
);
return (
<RHFSelect
isFetchindData={isFetching}
isError={isError}
errorsMessage={
hasNotLETypesPermission ? "Legal Entities types hidden" : undefined
}
name={name}
label={label}
disabled={disabled}
options={
data?.data?.map((item) => ({
value: item.name,
label: businessTypes[item.name as BusinessUnionTypes] as string,
})) || []
}
/>
);
};
export const businessTypes = {
general_partnership: "General Partnership",
individual_sole_proprietorship: "Sole Proprietor",
corporation: "Corporation",
limited_liability_company: "LLC",
limited_partnership: "Limited Partnership",
partnership: "Partnership",
tax_exempt_organization: "Tax Exempt Organization",
government_agency: "Government Agency",
};
export type BusinessUnionTypes = keyof typeof businessTypes;
export default BusinessTypeSelect;
|