From 6948af8b057d841025f47c950dfa9ccb0e9a51be Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 24 Jan 2026 09:40:41 +0330 Subject: [PATCH] list of category --- .env | 2 +- src/pages/product/category/List.tsx | 44 +++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 0810ff4..7fb068d 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -VITE_API_BASE_URL = 'http://172.27.64.88:4000' +VITE_API_BASE_URL = 'http://10.241.118.88:4000' VITE_TOKEN_NAME = 'negareh_t' VITE_REFRESH_TOKEN_NAME = 'negareh_rt' \ No newline at end of file diff --git a/src/pages/product/category/List.tsx b/src/pages/product/category/List.tsx index 59cb797..9be6074 100644 --- a/src/pages/product/category/List.tsx +++ b/src/pages/product/category/List.tsx @@ -1,23 +1,55 @@ import { type FC } from 'react' import { useGetCategory } from '../hooks/useProductData' import Table from '@/components/Table' -import type { RowDataType } from '@/components/types/TableTypes' +import type { ColumnType, RowDataType } from '@/components/types/TableTypes' import type { CategoryType } from '../types/Types' +import { Edit } from 'iconsax-react' const CategoryList: FC = () => { const { data } = useGetCategory() - const column = [{ - title: 'عنوان', - key: 'title', - }] + const column: ColumnType[] = [ + { + title: 'عنوان', + key: 'title', + }, + { + title: 'تعداد زیر درسته', + key: 'children', + render: (item) => { + return ( +
{item.children?.length}
+ ) + } + }, + { + title: 'اولویت', + key: 'order' + }, + { + title: '', + key: 'action', + render: () => { + return ( +
+ + + +
+ ) + } + } + ] return (

دسته بندی محصولات

- columns={column} data={data?.data || [] as (CategoryType & RowDataType)[]} />