import { useTranslate } from "ra-core"; import { Search } from "lucide-react"; import type { TextInputProps } from "@/components/admin/text-input"; import { TextInput } from "@/components/admin/text-input"; import { cn } from "@/lib/utils"; /** * Text input with a search icon, designed for filter forms without a label. * * It automatically uses the 'q' source for full-text search by default. * * @see {@link https://marmelab.com/shadcn-admin-kit/docs/searchinput/ SearchInput documentation} * * @example * import { List, DataTable, SearchInput } from '@/components/admin'; * * const postListFilters = [ * , * ]; * * const PostList = () => ( * * * * * * * * ); */ export const SearchInput = (inProps: SearchInputProps) => { const { label, className, ...rest } = inProps; const translate = useTranslate(); if (label) { throw new Error( " isn't designed to be used with a label prop. Use if you need a label.", ); } return (
); }; export type SearchInputProps = TextInputProps;