From 0229a1355d83c1ef372e73761b609ce353dbe681 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Thu, 7 May 2026 11:19:32 +0330 Subject: [PATCH] component button add catalogue --- src/assets/icons/add_catalogue.svg | 9 +++ src/pages/catalogue/List.tsx | 11 ++- .../components/ButtonAddCatalogue.tsx | 69 +++++++++++++++++++ 3 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 src/assets/icons/add_catalogue.svg create mode 100644 src/pages/catalogue/components/ButtonAddCatalogue.tsx diff --git a/src/assets/icons/add_catalogue.svg b/src/assets/icons/add_catalogue.svg new file mode 100644 index 0000000..6ae5df0 --- /dev/null +++ b/src/assets/icons/add_catalogue.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/pages/catalogue/List.tsx b/src/pages/catalogue/List.tsx index bb4730d..21288a5 100644 --- a/src/pages/catalogue/List.tsx +++ b/src/pages/catalogue/List.tsx @@ -2,17 +2,15 @@ import { type FC } from 'react' import { useGetCatalog } from '../home/hooks/useHomeData' import GridWrapper from '@/components/GridWrapper' import CatalogueItem from './components/CatalogueItem' -import Button from '@/components/Button' -import { Link } from 'react-router-dom' -import { Paths } from '@/config/Paths' +import ButtonAddCatalogue from './components/ButtonAddCatalogue' const CatalogueList: FC = () => { - const { data, refetch, isPending } = useGetCatalog() + const { data, refetch } = useGetCatalog() return (
- { + {/* { !isPending && !data?.data?.length &&
@@ -25,7 +23,7 @@ const CatalogueList: FC = () => {
- } + } */} { data?.data?.map((item) => { @@ -34,6 +32,7 @@ const CatalogueList: FC = () => { ) }) } +
) diff --git a/src/pages/catalogue/components/ButtonAddCatalogue.tsx b/src/pages/catalogue/components/ButtonAddCatalogue.tsx new file mode 100644 index 0000000..5f826c4 --- /dev/null +++ b/src/pages/catalogue/components/ButtonAddCatalogue.tsx @@ -0,0 +1,69 @@ +import type { FC } from 'react' +import { Paths } from '@/config/Paths' +import { Add } from 'iconsax-react' +import { Link } from 'react-router-dom' +import AddCatalogueIcon from '@/assets/icons/add_catalogue.svg' + +type Props = { + isFirst: boolean +} + +const ButtonAddCatalogue: FC = ({ isFirst }) => { + + if (isFirst) { + return ( + + add-catalogue +
+ +
کاتالوگ جدید
+
+ + ) + } + + return ( + + + + +
+ +
+ + + + ) +} + +export default ButtonAddCatalogue \ No newline at end of file