feat: attribute selects and options editors
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
import ObjectSelect, { ObjectSelectProps } from "@/components/selects/ObjectSelect/ObjectSelect";
|
||||
import { AttributeSelectSchema } from "@/lib/client";
|
||||
import ObjectSelect, {
|
||||
ObjectSelectProps,
|
||||
} from "@/components/selects/ObjectSelect/ObjectSelect";
|
||||
import { AttrSelectSchema } from "@/lib/client";
|
||||
import useAttributeSelectsList from "./useAttributeSelectsList";
|
||||
|
||||
|
||||
type Props = Omit<
|
||||
ObjectSelectProps<AttributeSelectSchema>,
|
||||
"data" | "getLabelFn"
|
||||
>;
|
||||
type Props = Omit<ObjectSelectProps<AttrSelectSchema>, "data" | "getLabelFn">;
|
||||
|
||||
const AttrSelectSelect = (props: Props) => {
|
||||
const { selects } = useAttributeSelectsList();
|
||||
@ -14,7 +12,6 @@ const AttrSelectSelect = (props: Props) => {
|
||||
return (
|
||||
<ObjectSelect
|
||||
label={"Объект для выбора"}
|
||||
getLabelFn={select => select.label}
|
||||
data={selects}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@ -19,7 +19,6 @@ const DefaultAttrOptionSelect = ({ selectId, ...props }: Props) => {
|
||||
{...props}
|
||||
data={options}
|
||||
onClear={() => props.onChange(null)}
|
||||
getLabelFn={(option: AttrOptionSchema) => option.label}
|
||||
clearable
|
||||
searchable
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user