import TextField from "@material-ui/core/TextField"; import React from "react"; import Grid from "../Grid"; import SingleAutocompleteSelectField, { SingleAutocompleteChoiceType, SingleAutocompleteSelectFieldLabels } from "../SingleAutocompleteSelectField"; import { ChangeEvent, FormErrors } from "../types/utils"; import FormSpacer from "../utils/FormSpacer"; export interface AddressInput { city: string; cityArea?: string; companyName?: string; country: string; countryArea?: string; firstName: string; lastName: string; phone: string; postalCode: string; streetAddress1: string; streetAddress2?: string; } export type EditAddressLabelKeys = | "firstName" | "lastName" | "companyName" | "phoneNumber" | "streetAddress1" | "streetAddress2" | "city" | "postalCode" | "country" | "countryArea"; export type EditAddressLabels = Record; export interface EditAddressProps { countries: SingleAutocompleteChoiceType[]; countryPickerDisplayValue: string; countryPickerLabels: Pick< SingleAutocompleteSelectFieldLabels, "addCustomValueText" | "noResultsLabel" >; data: AddressInput; disabled?: boolean; errors: FormErrors; labels: EditAddressLabels; onChange: (event: ChangeEvent) => void; onCountryChange: (event: ChangeEvent) => void; } const EditAddress: React.FC = ({ countries, countryPickerLabels, countryPickerDisplayValue, data, disabled, errors, labels, onChange, onCountryChange }) => ( <>
); EditAddress.displayName = "EditAddress"; export default EditAddress;