Skip to content

Commit

Permalink
handle type issue (badly)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchaselubitz committed Aug 26, 2024
1 parent 84c1c51 commit dc04362
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/address/CreateAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ import { geocodeByPlaceId } from 'react-google-places-autocomplete';
import { GoogleMap, Marker } from '@react-google-maps/api';
import { LegalEntity } from 'types';
import { useMutation } from '@apollo/client';
import { SingleValue } from 'react-select';

export type CreateAddressType = {
entity: LegalEntity;
actionOnCompletion: () => void;
};

type Option = any;
const CreateAddress: FC<CreateAddressType> = ({ entity, actionOnCompletion }) => {
const [addAddress, { data, error }] = useMutation(ADD_ENTITY_ADDRESS);
// const [map, setMap] = useState(null);
const [latLang, setLatLang] = useState<{ lat: number; lng: number }>({ lat: 0, lng: 0 });
const [autocompleteResults, setAutocompleteResults] = useState<google.maps.GeocoderResult[]>([]);
const [inputAddress, setInputAddress] = useState<{ value: any }>();
const [inputAddress, setInputAddress] = useState<{ value: SingleValue<Option> }>();

// (newValue: SingleValue<Option>, actionMeta: ActionMeta<Option>) => void

if (error) {
alert(`Oops. Looks like something went wrong: ${error.message}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const CustomAddressAutocomplete: FC<CustomAddressAutocompleteProps> = ({
apiKey={process.env.NEXT_PUBLIC_MAPS_API_KEY}
selectProps={{
value,
//@ts-ignore
onChange: setValue,
placeholder: '123 Easy st...',
styles: {
Expand Down

0 comments on commit dc04362

Please sign in to comment.