diff --git a/packages/frontend/src/components/ui/input.tsx b/packages/frontend/src/components/ui/input.tsx index 20a6190..36e7faf 100644 --- a/packages/frontend/src/components/ui/input.tsx +++ b/packages/frontend/src/components/ui/input.tsx @@ -1,4 +1,5 @@ import type * as React from "react"; +import { useRef } from "react"; import Icon from "@/components/ui/icon"; import { cn } from "@/lib/utils"; @@ -16,6 +17,9 @@ function Input({ }) { const maxLength = typeof props.maxLength === "number" ? props.maxLength : undefined; const currentLength = typeof props.value === "string" ? props.value.length : undefined; + const inputRef = useRef(null); + const isSearch = type === "search"; + const canClear = isSearch && typeof props.value === "string" && props.value.length > 0; return (
)} + {canClear && ( + + )} {showCounter && currentLength !== undefined && maxLength !== undefined && (