import clsx from "clsx"; import { useTranslation } from "react-i18next"; import ButtonPrimary from "../buttons/ButtonPrimary"; import { TextInput } from "~/ui/components/TextInput"; interface Props { value: string; setValue: React.Dispatch>; onNew?: () => void; onNewRoute?: string; placeholder?: string; className?: string; disabled?: boolean; size?: "xs" | "sm" | "md"; } // Subframe migration (strangler shim): renders Subframe TextInput with type="search" // (built-in search icon) behind the original InputSearch API. Subframe's own SearchInput // is purely presentational (hardcoded value="", no children/onChange/value binding) and // cannot back a controlled field, so TextInput is the correct controlled target — mirrors // the InputText shim. See docs/subframe/COMPONENT-MAPPING.md. export default function InputSearch({ value, setValue, onNew, onNewRoute, placeholder, className, disabled, size = "md" }: Props) { const { t } = useTranslation(); const resolvedPlaceholder = placeholder ?? t("shared.searchDot"); return (
setValue(e.currentTarget.value)} placeholder={resolvedPlaceholder} aria-label={resolvedPlaceholder} autoComplete="off" disabled={disabled} /> {onNew && {t("shared.new")}} {onNewRoute && {t("shared.new")}}
); }