othr
This commit is contained in:
@@ -6,6 +6,7 @@ import {DealService, DealServiceSchema} from "../../../../client";
|
||||
import {notifications} from "../../../../shared/lib/notifications.ts";
|
||||
import {modals} from "@mantine/modals";
|
||||
import {BaseTableRef} from "../../../../components/BaseTable/BaseTable.tsx";
|
||||
import DealProductsTable from "../../components/DealProductsTable/DealProductsTable.tsx";
|
||||
|
||||
const useDealServicesTableState = () => {
|
||||
const {selectedDeal, setSelectedDeal} = useDealPageContext();
|
||||
@@ -130,7 +131,6 @@ const useDealServicesTableState = () => {
|
||||
services: selectedDeal?.services || []
|
||||
}
|
||||
}
|
||||
|
||||
const DealEditDrawerServicesTable = () => {
|
||||
const {
|
||||
services,
|
||||
@@ -150,6 +150,29 @@ const DealEditDrawerServicesTable = () => {
|
||||
onMultipleDelete={onsServiceMultipleDelete}
|
||||
/>)
|
||||
}
|
||||
|
||||
const useDealProductTableState = () => {
|
||||
const {selectedDeal} = useDealPageContext();
|
||||
|
||||
return {
|
||||
clientId: selectedDeal?.clientId || -1,
|
||||
products: selectedDeal?.products || []
|
||||
}
|
||||
}
|
||||
|
||||
const DealEditDrawerProductsTable = () => {
|
||||
const {
|
||||
products,
|
||||
clientId
|
||||
} = useDealProductTableState();
|
||||
return (
|
||||
<DealProductsTable
|
||||
clientId={clientId}
|
||||
items={products}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const useDealEditDrawerState = () => {
|
||||
const {selectedDeal, setSelectedDeal} = useDealPageContext();
|
||||
return {
|
||||
@@ -168,6 +191,7 @@ const DealEditDrawer: FC = () => {
|
||||
onClose={onClose}
|
||||
opened={isVisible}>
|
||||
<DealEditDrawerServicesTable/>
|
||||
<DealEditDrawerProductsTable/>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user