* Icon and IconName * Button and ButtonGroup * UserAvatar * AvatarGroup * Avatar * WizardLayout * Dialogs * EmptyScreen * showToast and TextField * Editor * Skeleton * Skeleton * TopBanner and showToast * Button again * more * perf: Remove app-store reference from @calcom/ui * more * Fixing types * Icon * Fixed casing * dropdown * more * Select * more * Badge * List * more * Divider * more * fix * fix type check * refactor * fix * fix * fix * fix * fix * fix * fix * fix type check * fix * fix * fix * fix * more * more * more * more * add index file to components/command * fix * fix * fix * fix imports * fix * fix * fix * fix * fix * fix * fix * fix build errors * fix build errors * fix --------- Co-authored-by: Keith Williams <keithwillcode@gmail.com>
36 lines
800 B
TypeScript
36 lines
800 B
TypeScript
import cx from "@calcom/ui/classNames";
|
|
|
|
import { Input } from "../form";
|
|
import { Icon } from "../icon";
|
|
|
|
export type AddressInputProps = {
|
|
value: string;
|
|
id?: string;
|
|
placeholder?: string;
|
|
required?: boolean;
|
|
onChange: (val: string) => void;
|
|
className?: string;
|
|
};
|
|
|
|
function AddressInput({ value, onChange, ...rest }: AddressInputProps) {
|
|
return (
|
|
<div className="relative flex items-center">
|
|
<Icon
|
|
name="map-pin"
|
|
className="text-muted absolute left-0.5 ml-3 h-4 w-4 -translate-y-1/2"
|
|
style={{ top: "44%" }}
|
|
/>
|
|
<Input
|
|
{...rest}
|
|
value={value}
|
|
onChange={(e) => {
|
|
onChange(e.target.value);
|
|
}}
|
|
className={cx("pl-10", rest?.className)}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default AddressInput;
|