import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import AddressFormatter from "@saleor/components/AddressFormatter"; import CardTitle from "@saleor/components/CardTitle"; import { Hr } from "@saleor/components/Hr"; import { buttonMessages } from "@saleor/intl"; import { maybe } from "../../../misc"; import { CustomerDetails_user } from "../../types/CustomerDetails"; const useStyles = makeStyles(theme => ({ label: { fontWeight: 600, marginBottom: theme.spacing(1) } })); export interface CustomerAddressesProps { customer: CustomerDetails_user; disabled: boolean; onAddressManageClick: () => void; } const CustomerAddresses: React.FC = props => { const { customer, disabled, onAddressManageClick } = props; const classes = useStyles(props); const intl = useIntl(); return ( } /> {maybe(() => customer.defaultBillingAddress.id) !== maybe(() => customer.defaultShippingAddress.id) ? ( <> {maybe(() => customer.defaultBillingAddress) !== null && ( customer.defaultBillingAddress)} /> )} {maybe( () => customer.defaultBillingAddress && customer.defaultShippingAddress ) &&
} {maybe(() => customer.defaultShippingAddress) && ( customer.defaultShippingAddress)} /> )} ) : maybe(() => customer.defaultBillingAddress) === null && maybe(() => customer.defaultShippingAddress) === null ? ( ) : ( customer.defaultBillingAddress)} /> )}
); }; CustomerAddresses.displayName = "CustomerAddresses"; export default CustomerAddresses;