@@ -9,21 +9,27 @@ type Props = {
|
||||
|
||||
} & SelectHTMLAttributes<HTMLSelectElement>
|
||||
|
||||
const CategoriesSelect: FC<Props> = (props) => {
|
||||
const CategoriesSelect: FC<Props> = ({
|
||||
isDisableShowLable,
|
||||
placeholder,
|
||||
error_text,
|
||||
...selectProps
|
||||
}) => {
|
||||
|
||||
const { data: categories } = useGetCategory()
|
||||
|
||||
return (
|
||||
<Select
|
||||
label={props.isDisableShowLable ? undefined : 'دسته'}
|
||||
placeholder={props.placeholder || 'انتخاب'}
|
||||
label={isDisableShowLable ? undefined : 'دسته'}
|
||||
placeholder={placeholder || 'انتخاب'}
|
||||
error_text={error_text}
|
||||
items={categories?.data?.map((item) => {
|
||||
return {
|
||||
label: item.title,
|
||||
value: item.id + ''
|
||||
}
|
||||
}) || []}
|
||||
{...props}
|
||||
{...selectProps}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user