import { components, OptionProps, SingleValue } from "react-select"; import { faCheckCircle } from "@fortawesome/free-regular-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Badge, FilterableSelect } from "@app/components/v2"; import { AWS_REGIONS } from "@app/helpers/appConnections"; const Option = ({ isSelected, children, ...props }: OptionProps<(typeof AWS_REGIONS)[number]>) => { return (

{children}

{props.data.slug} {isSelected && ( )}
); }; type Props = { value: string; onChange: (value: string | undefined) => void; }; export const AwsRegionSelect = ({ value, onChange }: Props) => { return ( region.slug === value)} onChange={(option) => onChange((option as SingleValue<(typeof AWS_REGIONS)[number]>)?.slug)} options={AWS_REGIONS} placeholder="Select region..." getOptionLabel={(option) => option.name} getOptionValue={(option) => option.slug} components={{ Option }} /> ); };