diff --git a/src/components/Table.tsx b/src/components/Table.tsx index 5370c02..06b6a46 100644 --- a/src/components/Table.tsx +++ b/src/components/Table.tsx @@ -125,7 +125,7 @@ const Table = ({ {selectable && ( - + 0 && selectedRows.length === data.length} onCheckedChange={handleSelectAll} @@ -133,19 +133,13 @@ const Table = ({ )} {columns.map((col) => ( - - - + ))} {rowActions && ( - + )} - + ); }; @@ -166,7 +160,7 @@ const Table = ({
{(actionsPosition === 'top' || actionsPosition === 'above-header') && renderActions()} -
+
{renderHeader()} {actionsPosition === 'header-replace' && ( diff --git a/src/components/Td.tsx b/src/components/Td.tsx index 14314ed..eb57c7f 100644 --- a/src/components/Td.tsx +++ b/src/components/Td.tsx @@ -4,11 +4,12 @@ interface Props { text: string | number | ReactNode, children?: ReactNode, dir?: string, + className?: string, } const Td: FC = (props: Props) => { return ( -
+ { props.text ? props.text diff --git a/src/langs/fa.json b/src/langs/fa.json index 3610cfc..b58a2db 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -92,7 +92,11 @@ "smtp_server": "SMTP سرور", "smtp_port": "SMTP پورت", "username": "نام کاربری", - "password": "پسورد" + "password": "پسورد", + "record_dns": "رکوردهای DNS", + "record_dns_description": "در این قسمت میتوانید وضعیت رکوردهای DNS سرویس ایمیل خود را بررسی کنید.", + "your_domain": "دامنه شما", + "submit": "ثبت" }, "upload": "آپلود", "new_message": { diff --git a/src/pages/setting/domain/Domain.tsx b/src/pages/setting/domain/Domain.tsx index 648fb1f..8bc1804 100644 --- a/src/pages/setting/domain/Domain.tsx +++ b/src/pages/setting/domain/Domain.tsx @@ -1,79 +1,147 @@ +import Button from '@/components/Button' import Input from '@/components/Input' -import RadioGroup from '@/components/RadioGroup' +import Table from '@/components/Table' import { FC } from 'react' import { useTranslation } from 'react-i18next' +import { TickCircle } from 'iconsax-react' +import { Copy } from 'iconsax-react' + +interface DNSRecord extends Record { + id: number + status: 'verified' | 'pending' + type: string + name: string + value: string + number: number +} const Domain: FC = () => { - const { t } = useTranslation() - return ( -
-
-
-
-
- {t('setting.setting_fetch')} -
-
- {t('setting.setting_fetch_description')} -
-
-
- null} - selected='1' - /> -
-
-
-
-
-
-
- {t('setting.setting_smtp')} -
-
- {t('setting.setting_smtp_description')} -
-
-
- -
- -
-
- -
-
- -
-
-
-
+ const { t } = useTranslation() + + // نمونه داده‌های DNS records طبق تصویر + const dnsRecords: DNSRecord[] = [ + { + id: 1, + status: 'verified', + type: 'TXT', + name: 'example.com', + value: 'v=spf1 include:_spf.example.com ~all', + number: 1 + }, + { + id: 2, + status: 'verified', + type: 'MX | Priority:10', + name: 'example.com', + value: '10 mail.example.com', + number: 1 + }, + { + id: 3, + status: 'verified', + type: 'Cname | No CDN', + name: 'example.com', + value: 'v=spf1 include:_spf.example.com ~all', + number: 1 + }, + { + id: 4, + status: 'verified', + type: 'TXT', + name: 'example.com', + value: 'v=spf1 include:_spf.example.com ~all', + number: 1 + } + ] + + const columns = [ + { + title: 'شماره', + key: 'number', + width: '80px', + align: 'center' as const, + }, + { + title: 'مقدار رکورد', + key: 'value', + render: (record: DNSRecord) => ( +
+ + {record.value}
- ) + ) + }, + { + title: 'نام رکورد', + key: 'name', + render: (record: DNSRecord) => ( +
+ + {record.name} +
+ ) + }, + { + title: 'نوع رکورد', + key: 'type', + }, + { + title: 'وضعیت', + key: 'status', + render: (record: DNSRecord) => ( +
+ {record.status === 'verified' && ( + <> + + ثبت شده + + )} +
+ ) + }, + ] + + return ( +
+
+
+
+ {t('setting.record_dns')} +
+

+ {t('setting.record_dns_description')} +

+
+ +
+ + +
+
+ + +
+ + + + + + ) } export default Domain \ No newline at end of file diff --git a/src/pages/setting/mail-server/MailServer.tsx b/src/pages/setting/mail-server/MailServer.tsx index 1c87ae3..648fb1f 100644 --- a/src/pages/setting/mail-server/MailServer.tsx +++ b/src/pages/setting/mail-server/MailServer.tsx @@ -1,134 +1,79 @@ -import { FC, useState } from 'react' +import Input from '@/components/Input' +import RadioGroup from '@/components/RadioGroup' +import { FC } from 'react' import { useTranslation } from 'react-i18next' -const MailServer: FC = () => { +const Domain: FC = () => { const { t } = useTranslation() - const [serverType, setServerType] = useState('smtp') - const [host, setHost] = useState('') - const [port, setPort] = useState('') - const [username, setUsername] = useState('') - const [password, setPassword] = useState('') - const [encryption, setEncryption] = useState('tls') - return ( -
-
-

{t('setting.mail_server')}

- -
- -
-
- -
- - +
+
+
+
+
+ {t('setting.setting_fetch')} +
+
+ {t('setting.setting_fetch_description')} +
+
+
+ null} + selected='1' + />
- - {serverType === 'smtp' && ( - <> -
-
- - setHost(e.target.value)} - className='w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent' - placeholder='mail.example.com' - /> -
-
- - setPort(e.target.value)} - className='w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent' - placeholder='587' - /> -
+
+
+
+
+
+ {t('setting.setting_smtp')}
+
+ {t('setting.setting_smtp_description')} +
+
-
- - setUsername(e.target.value)} - className='w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent' - placeholder='username@example.com' +
+ +
+
- -
- - setPassword(e.target.value)} - className='w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent' +
+
- -
- - -
- -
- -
- - )} - - {serverType === 'api' && ( - <> -
- - +
-
- - -
- - )} +
+
) } -export default MailServer \ No newline at end of file +export default Domain \ No newline at end of file