This commit is contained in:
hamid zarghami
2025-07-29 17:00:36 +03:30
parent 5502e45d10
commit ef26c63e33
6 changed files with 35 additions and 46 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ VITE_REFRESH_TOKEN_NAME = 'dmail_refresh_token'
VITE_DANAK_BASE_URL ='https://api.danakcorp.com'
VITE_SOCKET_URL = 'wss://dmail-api.danakcorp.com/email'
# VITE_SOCKET_URL = 'ws://192.168.1.118:4000/email'
# VITE_SOCKET_URL = 'ws://192.168.1.106:4000/email'
VITE_BASE_URL = 'https://dmail-api.danakcorp.com'
# VITE_BASE_URL = 'http://192.168.1.106:4000'
+2 -2
View File
@@ -261,8 +261,8 @@ const Table = <T extends RowDataType>({
if (data.length === 0) {
return (
<tr>
<td colSpan={columns.length + (selectable ? 1 : 0) + (inlineActions ? 1 : 0) + (rowActions ? 1 : 0)} className="px-3 md:px-6 pb-6 md:pb-14 text-center text-gray-500">
<img src={NoData} alt='no data' className='w-[100px] mx-auto' />
<td colSpan={columns.length + (selectable ? 1 : 0) + (inlineActions ? 1 : 0) + (rowActions ? 1 : 0)} className="px-3 md:px-6 pb-6 md:pb-14 border-t border-border text-center text-gray-500">
<img src={NoData} alt='no data' className='w-[100px] mx-auto pt-14' />
<div className='-mt-5'>{noDataMessage}</div>
</td>
</tr>
+8 -12
View File
@@ -3,12 +3,11 @@ import { FC, useState } from 'react'
import Table from '../../components/Table';
import { ColumnType } from '../../components/types/TableTypes';
import { InfoCircle, Refresh2, Trash, RecoveryConvert } from 'iconsax-react';
import { RowActionItem } from '../../components/RowActionsDropdown';
import RowActionsDropdown, { RowActionItem } from '../../components/RowActionsDropdown';
import { useNavigate } from 'react-router-dom';
import { useEmptyTrash, useGetTrashMessages } from './hooks/useTrashData';
import { TrashMessage } from './types/TrashTypes';
import { useEmailActions } from '@/hooks/useEmailActions';
import Button from '@/components/Button';
import ModalConfrim from '@/components/ModalConfrim';
import { ErrorType } from '@/helpers/types';
import { toast } from '@/components/Toast';
@@ -146,6 +145,13 @@ const List: FC = () => {
className={`cursor-pointer min-w-[18px] ${isFetching ? 'animate-spin-reverse' : ''}`}
onClick={() => refetch()}
/>
<RowActionsDropdown actions={[
{
label: 'حذف همه',
icon: <Trash size={18} color='black' />,
onClick: () => setShowModal(true)
}
]} />
</div>
);
@@ -225,16 +231,6 @@ const List: FC = () => {
<div className='mt-2 md:mt-4 px-2 md:px-0'>
<div className='flex items-center justify-between'>
<h1>سطل زباله</h1>
<Button
className='w-fit px-6'
onClick={() => setShowModal(true)}
loading={isPending}
>
<div className='flex items-center gap-2'>
<Trash size={16} color="white" />
<span>حذف همه</span>
</div>
</Button>
</div>
<Filters
+1 -1
View File
@@ -100,7 +100,7 @@ const List: FC = () => {
<div className="flex flex-col gap-1 w-full">
<div className="flex items-center gap-2 w-full">
<span className="text-[#0038FF] text-sm font-medium">پیش نویس</span>
<span className="text-xs text-gray-500 whitespace-nowrap ml-auto">
<span className="text-[10px] text-gray-500 whitespace-nowrap ml-auto">
{formatTime(item.date)}
</span>
</div>
+15 -18
View File
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
import Table from '../../components/Table';
import { ColumnType } from '../../components/types/TableTypes';
import { InfoCircle, Refresh2, Trash, ArchiveTick, Star1 } from 'iconsax-react';
import { RowActionItem } from '../../components/RowActionsDropdown';
import RowActionsDropdown, { RowActionItem } from '../../components/RowActionsDropdown';
import { useNavigate } from 'react-router-dom';
import { useGetInbox, useMarkAllRead, useSummarizeEmail } from './hooks/useEmailData';
import { InboxMessage } from './types/Types';
@@ -15,7 +15,6 @@ import Favorite from './Components/Favorite';
import Summerize from './Components/Summerize';
import Intelligense from '@/assets/images/intelligense.svg'
import SummarizeModal from './Components/SummarizeModal';
import Button from '@/components/Button';
import ModalConfrim from '@/components/ModalConfrim';
import { ErrorType } from '@/helpers/types';
import { toast } from '@/components/Toast';
@@ -108,17 +107,17 @@ const List: FC = () => {
<span className="truncate font-medium text-sm flex-1 min-w-0">
{item.from.name || item.from.address}
</span>
<span className="text-xs text-gray-500 whitespace-nowrap">
<span className="text-[10px] text-gray-500 whitespace-nowrap">
{formatTime(item.date)}
</span>
</div>
<div className="truncate w-full text-sm font-medium">
{item.subject || 'بدون موضوع'}
{item.subject}
</div>
<div className="truncate w-full text-xs text-gray-600">
{item.intro || 'بدون متن پیش‌نمایش'}
{item.intro}
</div>
</div>
)
@@ -164,6 +163,17 @@ const List: FC = () => {
className={`cursor-pointer min-w-[18px] ${isFetching ? 'animate-spin-reverse' : ''}`}
onClick={() => refetch()}
/>
<RowActionsDropdown actions={[
{
label: 'خواندن همه',
icon: <img src={MarkAsRead} className='w-[18px]' />,
onClick: () => handleMarkAll()
}
]} />
</div>
);
@@ -293,19 +303,6 @@ const List: FC = () => {
<div className='mt-2 md:mt-4 px-2 md:px-0'>
<div className='flex justify-between items-center'>
<h1 className="">{t('received.title')}</h1>
<Button
onClick={() => setShowModal(true)}
loading={isMarkingAllRead}
className='w-fit'
>
<div className='flex items-center gap-2'>
<img
src={MarkAsRead}
className='w-[18px] filter invert'
/>
<span>خواندن همه</span>
</div>
</Button>
</div>
<Filters
+8 -12
View File
@@ -3,12 +3,11 @@ import { FC, useState } from 'react'
import Table from '../../components/Table';
import { ColumnType } from '../../components/types/TableTypes';
import { InfoCircle, Refresh2, Trash, RecoveryConvert } from 'iconsax-react';
import { RowActionItem } from '../../components/RowActionsDropdown';
import RowActionsDropdown, { RowActionItem } from '../../components/RowActionsDropdown';
import { useNavigate } from 'react-router-dom';
import { useEmptySpam, useGetSpamMessages } from './hooks/useSpamData';
import { SpamMessage } from './types/SpamTypes';
import { useEmailActions } from '@/hooks/useEmailActions';
import Button from '@/components/Button';
import ModalConfrim from '@/components/ModalConfrim';
import { ErrorType } from '@/helpers/types';
import { toast } from '@/components/Toast';
@@ -142,6 +141,13 @@ const List: FC = () => {
className={`cursor-pointer min-w-[18px] ${isFetching ? 'animate-spin-reverse' : ''}`}
onClick={() => refetch()}
/>
<RowActionsDropdown actions={[
{
label: 'حذف همه',
icon: <Trash size={18} color='black' />,
onClick: () => setShowModal(true)
}
]} />
</div>
);
@@ -220,16 +226,6 @@ const List: FC = () => {
<div className='mt-2 md:mt-4 px-2 md:px-0'>
<div className='flex items-center justify-between'>
<h1>هرزنامه ها</h1>
<Button
className='w-fit px-6'
onClick={() => setShowModal(true)}
loading={isPending}
>
<div className='flex items-center gap-2'>
<Trash size={16} color="white" />
<span>حذف همه</span>
</div>
</Button>
</div>
<Filters