From 92ba2b9f75fa8778eaba79a5bdfa6078f1e10c1f Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 29 Dec 2025 17:02:46 +0330 Subject: [PATCH] date picker --- src/pages/customers/List.tsx | 7 +----- .../components/DiscountCodesTable.tsx | 5 ++-- src/pages/settings/Setting.tsx | 12 +--------- .../statistics/components/RevenueChart.tsx | 23 +++++++++++-------- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/pages/customers/List.tsx b/src/pages/customers/List.tsx index f40bb39..79978e5 100644 --- a/src/pages/customers/List.tsx +++ b/src/pages/customers/List.tsx @@ -1,7 +1,7 @@ import Button from '@/components/Button' import Table from '@/components/Table' import Filters, { type FilterValues, type FieldType } from '@/components/Filters' -import { Add, Eye } from 'iconsax-react' +import { Add } from 'iconsax-react' import { type FC, useState, useMemo, useCallback } from 'react' import { Pages } from '@/config/Pages' import { Link } from 'react-router-dom' @@ -118,11 +118,6 @@ const CustomersList: FC = () => { { key: 'details', title: 'جزئیات', - render: (item: CustomerListRow) => ( - - - - ), }, ], []) diff --git a/src/pages/customers/components/DiscountCodesTable.tsx b/src/pages/customers/components/DiscountCodesTable.tsx index 2d39647..cffa61a 100644 --- a/src/pages/customers/components/DiscountCodesTable.tsx +++ b/src/pages/customers/components/DiscountCodesTable.tsx @@ -1,5 +1,4 @@ import { type FC } from 'react' -import { TicketDiscount } from 'iconsax-react' interface DiscountCode { id: string @@ -81,10 +80,10 @@ const DiscountCodesTable: FC = () => { - + */} ) } diff --git a/src/pages/settings/Setting.tsx b/src/pages/settings/Setting.tsx index 6a8cb91..ba24431 100644 --- a/src/pages/settings/Setting.tsx +++ b/src/pages/settings/Setting.tsx @@ -1,5 +1,5 @@ import Tabs from '@/components/Tabs' -import { KeySquare, Money2, Setting4, TruckFast } from 'iconsax-react' +import { Money2, Setting4 } from 'iconsax-react' import { useState, type FC } from 'react' import { SettingTabEnum } from './enum/Enum' import GeneralSettings from './GeneralSettings' @@ -21,21 +21,11 @@ const Setting: FC = () => { label: 'عمومی', value: SettingTabEnum.GENERAL, }, - { - icon: , - label: 'رمز عبور', - value: SettingTabEnum.PASSWORD, - }, { icon: , label: 'تنظیمات امتیاز', value: SettingTabEnum.FINANCIAL, }, - { - icon: , - label: 'روش های ارسال', - value: SettingTabEnum.DELIVERY, - }, ]} onChange={(value: string) => setActiveTab(value as SettingTabEnum)} active={activeTab} diff --git a/src/pages/statistics/components/RevenueChart.tsx b/src/pages/statistics/components/RevenueChart.tsx index 17ec2da..be59296 100644 --- a/src/pages/statistics/components/RevenueChart.tsx +++ b/src/pages/statistics/components/RevenueChart.tsx @@ -14,6 +14,7 @@ import Button from '@/components/Button' import { useGetPaymentsChart } from '../hooks/useStatsData' import { formatPrice } from '@/helpers/func' import PageLoading from '@/components/PageLoading' +import moment from 'moment-jalaali' const RevenueChart: FC = () => { const [selectedTab] = useState< @@ -22,6 +23,12 @@ const RevenueChart: FC = () => { const [startDate, setStartDate] = useState('') const [endDate, setEndDate] = useState('') + const convertToPersian = (gregorianDate: string | null | undefined): string | undefined => { + if (!gregorianDate) return undefined + const persianDate = moment(gregorianDate, 'YYYY-MM-DD').format('jYYYY-jMM-jDD') + return persianDate + } + const apiParams = useMemo(() => { const params: { period?: 'daily' | 'monthly' | 'yearly'; @@ -177,14 +184,6 @@ const RevenueChart: FC = () => { ) } - if (isLoading) { - return ( -
- -
- ) - } - return (
{/* Header */} @@ -198,11 +197,13 @@ const RevenueChart: FC = () => {
{/* نمودار */} - {chartData.length === 0 ? ( + {isLoading ? ( +
+ +
+ ) : chartData.length === 0 ? (
داده‌ای برای نمایش وجود ندارد