create rolelist

This commit is contained in:
hamid zarghami
2025-02-02 14:33:58 +03:30
parent 85a2ac3b4a
commit 8edcda3342
9 changed files with 440 additions and 2 deletions
+102
View File
@@ -0,0 +1,102 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '../../components/Button'
import { TickCircle } from 'iconsax-react'
import Input from '../../components/Input'
import Select from '../../components/Select'
import UploadBoxDraggble from '../../components/UploadBoxDraggble'
const CreateUser: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4'>
<div className='flex justify-between items-center'>
<div>
{t('service.cateory_services')}
</div>
<Button
className='w-fit px-8'
>
<div className='flex gap-2'>
<TickCircle
className='size-5'
color='white'
/>
<div className='text-sm'>
{t('user.submit_user')}
</div>
</div>
</Button>
</div>
<div className='flex gap-6 mt-9'>
<div className='flex-1 bg-white py-10 xl:px-10 px-5 rounded-3xl'>
<div>
{t('user.info_user')}
</div>
<div className='rowTwoInput mt-8'>
<Input
label={t('user.name')}
/>
<Input
label={t('user.family')}
/>
</div>
<div className='rowTwoInput mt-8'>
<Input
label={t('user.title_job')}
/>
<Select
label={t('user.role')}
placeholder={t('select')}
items={[
{ label: 'Admin', value: 'admin' },
{ label: 'User', value: 'user' },
]}
/>
</div>
<div className='rowTwoInput mt-8'>
<Input
label={t('user.email')}
/>
<Input
label={t('user.phone_number')}
/>
</div>
</div>
<div className='bg-white p-8 w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>
<Input
label={t('user.password')}
/>
<div className='mt-8'>
<Input
label={t('user.reapeat_password')}
/>
</div>
<div className='mt-8'>
<div className='text-sm'>
{t('user.image')}
</div>
<div className='mt-2'>
<UploadBoxDraggble
label={t('user.image')}
onChange={() => null}
/>
</div>
</div>
</div>
</div>
</div>
)
}
export default CreateUser
+101
View File
@@ -0,0 +1,101 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '../../components/Button'
import { Add, Eye } from 'iconsax-react'
import Select from '../../components/Select'
import Input from '../../components/Input'
import Td from '../../components/Td'
import { Link } from 'react-router-dom'
import { Pages } from '../../config/Pages'
const UsersList: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4'>
<div className='flex w-full justify-between items-center'>
<div>
{t('user.users_list')}
</div>
<div>
<Button
className='px-5'
>
<div className='flex gap-2'>
<Add
className='size-5'
color='#fff'
/>
<div>{t('user.add_user')}</div>
</div>
</Button>
</div>
</div>
<div className='flex justify-between items-center mt-12'>
<div className='flex gap-4'>
<Select
className='w-36'
items={[
{ label: 'All', value: 'all' },
{ label: 'Active', value: 'active' },
{ label: 'Inactive', value: 'inactive' },
]}
placeholder={t('service.category')}
/>
</div>
<div>
<Input
variant='search'
placeholder={t('service.search')}
className='bg-white border border-border'
/>
</div>
</div>
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
<table className='w-full text-sm '>
<thead className='thead'>
<tr>
<Td text={t('user.name')} />
<Td text={t('user.title_job')} />
<Td text={t('user.email')} />
<Td text={t('user.role')} />
<Td text={t('detail')} />
<Td text={''} />
</tr>
</thead>
<tbody>
<tr className='tr'>
<Td text='مهرداد مظفری' />
<Td text={'کارشناس فنی'} />
<Td text={'info@example.com'} />
<Td text={'سطح ۱'} />
<Td text={''}>
<Link to={Pages.ticket.detail + '1'}>
<Eye size={20} color='#8C90A3' />
</Link>
</Td>
<Td text={''} />
</tr>
<tr className='tr'>
<Td text='مهرداد مظفری' />
<Td text={'کارشناس فنی'} />
<Td text={'info@example.com'} />
<Td text={'سطح ۱'} />
<Td text={''}>
<Link to={Pages.ticket.detail + '1'}>
<Eye size={20} color='#8C90A3' />
</Link>
</Td>
<Td text={''} />
</tr>
</tbody>
</table>
</div>
</div>
)
}
export default UsersList
+59
View File
@@ -0,0 +1,59 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '../../components/Button'
import { TickCircle } from 'iconsax-react'
import Input from '../../components/Input'
const RoleCreate: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4'>
<div className='flex justify-between items-center'>
<div>
{t('user.add_role')}
</div>
<Button
className='w-fit px-8'
>
<div className='flex gap-2'>
<TickCircle
className='size-5'
color='white'
/>
<div className='text-sm'>
{t('user.submit_role')}
</div>
</div>
</Button>
</div>
<div className='flex gap-6 mt-9'>
<div className='flex-1 bg-white py-10 xl:px-10 px-5 rounded-3xl'>
<Input
label={t('user.title_role')}
/>
<div className='mt-8'>
<div className='text-sm'>
{t('user.permissions')}
</div>
<div className='mt-5 flex'>
</div>
</div>
</div>
<div className='bg-white p-8 w-sidebar hidden xl:block rounded-3xl overflow-hidden relative'>
</div>
</div>
</div>
)
}
export default RoleCreate
+81
View File
@@ -0,0 +1,81 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '../../components/Button'
import { Add, Eye } from 'iconsax-react'
import Input from '../../components/Input'
import Td from '../../components/Td'
import { Link } from 'react-router-dom'
import { Pages } from '../../config/Pages'
const RolesList: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4'>
<div className='flex w-full justify-between items-center'>
<div>
{t('user.roles_list')}
</div>
<div>
<Button
className='px-5'
>
<div className='flex gap-2'>
<Add
className='size-5'
color='#fff'
/>
<div>{t('user.add_role')}</div>
</div>
</Button>
</div>
</div>
<div className='flex justify-end items-center mt-12'>
<div>
<Input
variant='search'
placeholder={t('user.role_search')}
className='bg-white border border-border'
/>
</div>
</div>
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
<table className='w-full text-sm '>
<thead className='thead'>
<tr>
<Td text={t('user.title')} />
<Td text={t('user.user')} />
<Td text={t('detail')} />
</tr>
</thead>
<tbody>
<tr className='tr'>
<Td text='ادمین' />
<Td text={'۳ کاربر'} />
<Td text={''}>
<Link to={Pages.ticket.detail + '1'}>
<Eye size={20} color='#8C90A3' />
</Link>
</Td>
</tr>
<tr className='tr'>
<Td text='ادمین' />
<Td text={'۳ کاربر'} />
<Td text={''}>
<Link to={Pages.ticket.detail + '1'}>
<Eye size={20} color='#8C90A3' />
</Link>
</Td>
</tr>
</tbody>
</table>
</div>
</div>
)
}
export default RolesList