Files
Fulfillment-Frontend/src/components/Selects/ClientSelect/ClientSelect.tsx

24 lines
679 B
TypeScript

import { FC } from "react";
import { ClientSchema } from "../../../client";
import useClientsList from "../../../pages/ClientsPage/hooks/useClientsList.tsx";
import ObjectSelect, { ObjectSelectProps } from "../../ObjectSelect/ObjectSelect.tsx";
type Props = Omit<
ObjectSelectProps<ClientSchema>,
"data" | "getLabelFn" | "getValueFn"
>;
const ClientSelect: FC<Props> = (props: Props) => {
const { clients } = useClientsList({ all: true });
return (
<ObjectSelect
{...props}
placeholder={"Выберите клиента"}
data={clients.filter(cl => !cl.isDeleted)}
/>
);
};
export default ClientSelect;