Create and update customer
This commit is contained in:
+25
-2
@@ -1,10 +1,13 @@
|
||||
import { useState, type FC } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useGetUsers } from './hooks/useUserData'
|
||||
import Table from '@/components/Table'
|
||||
import moment from 'moment-jalaali'
|
||||
import Button from '@/components/Button'
|
||||
import { AddSquare, Edit } from 'iconsax-react'
|
||||
import { Paths } from '@/config/Paths'
|
||||
|
||||
const UsersList: FC = () => {
|
||||
|
||||
const [page, setPage] = useState<number>(1)
|
||||
const { data } = useGetUsers(page)
|
||||
|
||||
@@ -12,6 +15,14 @@ const UsersList: FC = () => {
|
||||
<div className='mt-5'>
|
||||
<div className='flex justify-between items-center'>
|
||||
<h1 className='text-lg font-light'>کاربران</h1>
|
||||
<Link to={Paths.users.create}>
|
||||
<Button className='w-fit px-6'>
|
||||
<div className='flex gap-1.5'>
|
||||
<AddSquare size={18} color='black' />
|
||||
<div className='text-[13px] font-light'>ساخت مشتری</div>
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<Table
|
||||
@@ -42,6 +53,19 @@ const UsersList: FC = () => {
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'actions',
|
||||
title: 'عملیات',
|
||||
render: (item) => (
|
||||
<Link
|
||||
to={`${Paths.users.update}${item.id}`}
|
||||
className="inline-block p-1 hover:opacity-70"
|
||||
aria-label="ویرایش"
|
||||
>
|
||||
<Edit size={20} color="#0037FF" />
|
||||
</Link>
|
||||
),
|
||||
},
|
||||
]}
|
||||
data={data?.data}
|
||||
pagination={{
|
||||
@@ -50,7 +74,6 @@ const UsersList: FC = () => {
|
||||
totalPages: data?.meta?.totalPages as number
|
||||
}}
|
||||
/>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user