crap
This commit is contained in:
40
src/pages/ProductsPage/ui/ProductsPage.tsx
Normal file
40
src/pages/ProductsPage/ui/ProductsPage.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import PageBlock from "../../../components/PageBlock/PageBlock.tsx";
|
||||
import {FC, useState} from "react";
|
||||
import styles from './ProductsPage.module.css';
|
||||
import {Drawer} from "@mantine/core";
|
||||
import {useDisclosure} from "@mantine/hooks";
|
||||
import ClientSelect from "../../../components/Selects/ClientSelect/ClientSelect.tsx";
|
||||
import ProductsTable from "../components/ProductsTable/ProductsTable.tsx";
|
||||
import useProductsList from "../hooks/useProductsList.tsx";
|
||||
|
||||
export const ProductsPage: FC = () => {
|
||||
const [opened, {open, close}] = useDisclosure(false);
|
||||
const [clientId, setClientId] = useState(-1);
|
||||
const {products} = useProductsList({clientId, page: 0, itemsPerPage: 10});
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
opened={opened}
|
||||
onClose={close}
|
||||
position={"right"}
|
||||
size={"100%"}
|
||||
/>
|
||||
<div className={styles['container']}>
|
||||
|
||||
<PageBlock>
|
||||
<div className={styles['top-panel']}>
|
||||
|
||||
<ClientSelect onChange={event => setClientId(event.id)}/>
|
||||
</div>
|
||||
|
||||
</PageBlock>
|
||||
<PageBlock>
|
||||
<div className={styles['body-container']}>
|
||||
<ProductsTable products={products}/>
|
||||
</div>
|
||||
</PageBlock>
|
||||
</div>
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user