From 7bf0984698e43b9aa2dd879f65951318ed410390 Mon Sep 17 00:00:00 2001 From: Maze <167211895+mazeincoding@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:20:04 +0100 Subject: codebase overhaul (#697) --- apps/web/src/components/ui/phone-input.tsx | 246 ++++++++++++++--------------- 1 file changed, 123 insertions(+), 123 deletions(-) (limited to 'apps/web/src/components/ui/phone-input.tsx') diff --git a/apps/web/src/components/ui/phone-input.tsx b/apps/web/src/components/ui/phone-input.tsx index ca85df8f..1d0eeb07 100644 --- a/apps/web/src/components/ui/phone-input.tsx +++ b/apps/web/src/components/ui/phone-input.tsx @@ -5,163 +5,163 @@ import flags from "react-phone-number-input/flags"; import { Button } from "./button"; import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, } from "./command"; import { Input } from "./input"; import { Popover, PopoverContent, PopoverTrigger } from "./popover"; import { ScrollArea } from "./scroll-area"; -import { cn } from "../../lib/utils"; +import { cn } from "@/utils/ui"; type PhoneInputProps = Omit< - React.ComponentProps<"input">, - "onChange" | "value" | "ref" + React.ComponentProps<"input">, + "onChange" | "value" | "ref" > & - Omit, "onChange"> & { - onChange?: (value: RPNInput.Value) => void; - }; + Omit, "onChange"> & { + onChange?: (value: RPNInput.Value) => void; + }; const PhoneInput: React.ForwardRefExoticComponent = - React.forwardRef, PhoneInputProps>( - ({ className, onChange, defaultCountry = "US", ...props }, ref) => { - return ( - onChange?.(value || ("" as RPNInput.Value))} - {...props} - /> - ); - } - ); + React.forwardRef, PhoneInputProps>( + ({ className, onChange, defaultCountry = "US", ...props }, ref) => { + return ( + onChange?.(value || ("" as RPNInput.Value))} + {...props} + /> + ); + }, + ); PhoneInput.displayName = "PhoneInput"; const InputComponent = React.forwardRef< - HTMLInputElement, - React.ComponentProps<"input"> + HTMLInputElement, + React.ComponentProps<"input"> >(({ className, ...props }, ref) => ( - + )); InputComponent.displayName = "InputComponent"; type CountryEntry = { label: string; value: RPNInput.Country | undefined }; type CountrySelectProps = { - disabled?: boolean; - value: RPNInput.Country; - options: CountryEntry[]; - onChange: (country: RPNInput.Country) => void; + disabled?: boolean; + value: RPNInput.Country; + options: CountryEntry[]; + onChange: (country: RPNInput.Country) => void; }; const CountrySelect = ({ - disabled, - value: selectedCountry, - options: countryList, - onChange, + disabled, + value: selectedCountry, + options: countryList, + onChange, }: CountrySelectProps) => { - return ( - - - - - - - - - - No country found. - - {countryList.map(({ value, label }) => - value ? ( - - ) : null - )} - - - - - - - ); + return ( + + + + + + + + + + No country found. + + {countryList.map(({ value, label }) => + value ? ( + + ) : null, + )} + + + + + + + ); }; interface CountrySelectOptionProps extends RPNInput.FlagProps { - selectedCountry: RPNInput.Country; - onChange: (country: RPNInput.Country) => void; + selectedCountry: RPNInput.Country; + onChange: (country: RPNInput.Country) => void; } const CountrySelectOption = ({ - country, - countryName, - selectedCountry, - onChange, + country, + countryName, + selectedCountry, + onChange, }: CountrySelectOptionProps) => { - return ( - onChange(country)}> - - {countryName} - {`+${RPNInput.getCountryCallingCode(country)}`} - - - ); + return ( + onChange(country)}> + + {countryName} + {`+${RPNInput.getCountryCallingCode(country)}`} + + + ); }; const FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => { - const Flag = flags[country]; + const Flag = flags[country]; - return ( - - {Flag && } - - ); + return ( + + {Flag && } + + ); }; export { PhoneInput }; -- cgit v1.3.1