2023-01-26 22:51:03 +00:00
|
|
|
import { FiMapPin } from "../components/icon";
|
2022-11-05 20:10:10 +00:00
|
|
|
|
2023-01-18 10:58:15 +00:00
|
|
|
export type AddressInputProps = {
|
|
|
|
value: string;
|
|
|
|
id?: string;
|
|
|
|
placeholder?: string;
|
|
|
|
required?: boolean;
|
|
|
|
onChange: (val: string) => void;
|
|
|
|
className?: string;
|
2022-11-05 20:10:10 +00:00
|
|
|
};
|
|
|
|
|
2023-01-18 10:58:15 +00:00
|
|
|
function AddressInput({ className = "", value, onChange, ...rest }: AddressInputProps) {
|
2022-11-05 20:10:10 +00:00
|
|
|
return (
|
|
|
|
<div className="relative ">
|
2023-01-23 23:08:01 +00:00
|
|
|
<FiMapPin color="#D2D2D2" className="absolute top-1/2 left-0.5 ml-3 h-6 -translate-y-1/2" />
|
2022-11-05 20:10:10 +00:00
|
|
|
<input
|
|
|
|
{...rest}
|
2023-01-18 10:58:15 +00:00
|
|
|
value={value}
|
|
|
|
onChange={(e) => {
|
|
|
|
onChange(e.target.value);
|
|
|
|
}}
|
2022-11-05 20:10:10 +00:00
|
|
|
color="#D2D2D2"
|
2023-01-20 22:04:58 +00:00
|
|
|
className={`${className} focus-within:border-brand dark:bg-darkgray-100 dark:border-darkgray-300 block h-10 w-full rounded-md border border border-gray-300 py-px pl-10 text-sm outline-none ring-black focus-within:ring-1 disabled:text-gray-500 disabled:opacity-50 dark:text-white dark:placeholder-gray-500 dark:selection:bg-green-500 disabled:dark:text-gray-500`}
|
2022-11-05 20:10:10 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AddressInput;
|