import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import CardSpacer from "@saleor/components/CardSpacer"; import CardTitle from "@saleor/components/CardTitle"; import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import ControlledSwitch from "@saleor/components/ControlledSwitch"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment"; import { commonMessages } from "@saleor/intl"; import { AttributeTypeEnum } from "@saleor/types/globalTypes"; import { getFormErrors } from "@saleor/utils/errors"; import getAttributeErrorMessage from "@saleor/utils/errors/attribute"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { AttributePageFormData } from "../AttributePage"; export interface AttributePropertiesProps { data: AttributePageFormData; disabled: boolean; errors: AttributeErrorFragment[]; onChange: (event: React.ChangeEvent) => void; } const AttributeProperties: React.FC = ({ data, errors, disabled, onChange }) => { const intl = useIntl(); const formErrors = getFormErrors(["storefrontSearchPosition"], errors); return ( {/*
} onChange={onChange} /> */}
{data.type === AttributeTypeEnum.PRODUCT_TYPE && ( <> )} {data.filterableInStorefront && data.type === AttributeTypeEnum.PRODUCT_TYPE && ( )} } checked={data.visibleInStorefront} onChange={onChange} disabled={disabled} />
} checked={data.filterableInDashboard} onChange={onChange} disabled={disabled} /> } checked={data.availableInGrid} onChange={onChange} disabled={disabled} />
); }; AttributeProperties.displayName = "AttributeProperties"; export default AttributeProperties;