create product

This commit is contained in:
hamid zarghami
2026-01-24 15:38:17 +03:30
parent 54eb477200
commit cb174bf0dc
11 changed files with 261 additions and 43 deletions
@@ -0,0 +1,29 @@
import { type FC, type SelectHTMLAttributes } from 'react'
import { useGetCategory } from '../hooks/useProductData'
import Select from '@/components/Select'
type Props = {
error_text?: string,
} & SelectHTMLAttributes<HTMLSelectElement>
const CategoriesSelect: FC<Props> = (props) => {
const { data: categories } = useGetCategory()
return (
<Select
label='دسته'
placeholder='انتخاب'
items={categories?.data?.map((item) => {
return {
label: item.title,
value: item.id
}
}) || []}
{...props}
/>
)
}
export default CategoriesSelect