From 19169e43dea0ac0e693ffdc65c9e6ab02294a16c Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 13 Jul 2026 22:43:53 +0330 Subject: [PATCH] update --- src/components/Td.tsx | 23 +++++++-- src/pages/products/List.tsx | 97 +++++++++++++++++++++++-------------- 2 files changed, 79 insertions(+), 41 deletions(-) diff --git a/src/components/Td.tsx b/src/components/Td.tsx index d2a995f..4f61bfc 100644 --- a/src/components/Td.tsx +++ b/src/components/Td.tsx @@ -1,19 +1,32 @@ import { type FC, type ReactNode } from 'react' +import { clx } from '../helpers/utils' interface Props { text: string, children?: ReactNode, dir?: string, + align?: 'start' | 'center' | 'end', + className?: string, } const Td: FC = (props: Props) => { + const alignClass = props.align === 'end' + ? 'text-end' + : props.align === 'center' + ? 'text-center' + : props.align === 'start' + ? 'text-start' + : '' + return ( - + { - props.text ? - props.text - : - props.children + props.text + ? props.text + : props.children } ) diff --git a/src/pages/products/List.tsx b/src/pages/products/List.tsx index 105c81e..bce0a25 100644 --- a/src/pages/products/List.tsx +++ b/src/pages/products/List.tsx @@ -13,7 +13,7 @@ import Td from '../../components/Td'; import TrashWithConfrim from '../../components/TrashWithConfrim'; import ModalConfrim from '../../components/ModalConfrim'; import PageTitle from '../../components/PageTitle'; -import { Edit } from 'iconsax-react'; +import { Box1 } from 'iconsax-react'; import Button from '@/components/Button'; import { Link } from 'react-router-dom'; import { Pages } from '@/config/Pages'; @@ -140,8 +140,8 @@ const List: FC = () => { className='w-fit' /> -
- +
+
{products.length === 0 ? ( - @@ -166,7 +166,7 @@ const List: FC = () => { products.map((product: ProductListType) => ( - + @@ -203,26 +213,41 @@ const List: FC = () => { text={getStatusText(product.status)} /> - + +
@@ -150,15 +150,15 @@ const List: FC = () => { - - - + + +
+ هیچ محصولی یافت نشد
-
+
{product.title_fa} {
-
-
+
+
{product.title_fa}
-
+
{product.title_en}
- + + + {product.brand_title_fa} + + + + {product.category_title_fa} + + - + - - -
- { - product.status !== ProductStatus.Draft && ( -
+ + {(product.default_variant?.price?.selling_price ?? 0).toLocaleString('fa-IR')} + تومان + + + + {product.default_variant?.stock ?? 0} + + +
+ {product.status !== ProductStatus.Draft && ( + + )} {product.status === ProductStatus.Draft && ( - + )}