print base
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { type FC } from 'react'
|
||||
import { useGetSections } from './hooks/usePrintData'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Paths } from '@/config/Paths'
|
||||
import Button from '@/components/Button'
|
||||
import { AddSquare } from 'iconsax-react'
|
||||
|
||||
const SectionList: FC = () => {
|
||||
|
||||
const { data } = useGetSections()
|
||||
|
||||
return (
|
||||
<div className='mt-5'>
|
||||
<div className='flex justify-between items-center'>
|
||||
<h1 className='text-lg font-light'>محصولات</h1>
|
||||
|
||||
<Link
|
||||
to={Paths.print.list}
|
||||
>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default SectionList
|
||||
@@ -0,0 +1,9 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/PrintService";
|
||||
|
||||
export const useGetSections = () => {
|
||||
return useQuery({
|
||||
queryKey: ["sections"],
|
||||
queryFn: api.getSections,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import axios from "@/config/axios";
|
||||
|
||||
export const getSections = async () => {
|
||||
const { data } = await axios.get(`/admin/section`);
|
||||
return data;
|
||||
};
|
||||
Reference in New Issue
Block a user