feat: attribute selects and options editors

This commit is contained in:
2025-11-04 12:19:44 +04:00
parent 311210394f
commit 33dd1e1c0f
31 changed files with 1833 additions and 112 deletions

View File

@ -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}
/>

View File

@ -19,7 +19,6 @@ const DefaultAttrOptionSelect = ({ selectId, ...props }: Props) => {
{...props}
data={options}
onClear={() => props.onChange(null)}
getLabelFn={(option: AttrOptionSchema) => option.label}
clearable
searchable
/>