/* eslint-disable @typescript-eslint/camelcase */ import React from 'react'; import {AddressAttributes} from 'checkout/ShippingAddressProps'; import {Link} from 'display-library/Link'; import './ShippingAddressListItem.scss'; interface Props { address: AddressAttributes; handleEditClick?(): void; showEditButton?: boolean; showLine2?: boolean; showPhone?: boolean; } const ShippingAddressListItem: React.FC = ({ showEditButton = false, handleEditClick, showLine2 = true, showPhone = true, address }) => { const { address_line1, address_line2, country_code, postal_code, first_name, last_name, state, phone, city } = address; const editButton = (
); return (
{`${first_name} ${last_name}`}
{address_line1}
{showLine2 &&
{address_line2}
}
{[city, state, postal_code, country_code].filter(Boolean).join(', ')}
{showPhone &&
{phone}
}
{showEditButton && editButton}
); }; export default ShippingAddressListItem;