29 lines
616 B
TypeScript
29 lines
616 B
TypeScript
import { ContentType } from "@/types"
|
|
import { FC } from "react"
|
|
import { Input } from "../ui/input"
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
interface SidebarSearchProps {
|
|
contentType: ContentType
|
|
searchTerm: string
|
|
setSearchTerm: Function
|
|
}
|
|
|
|
export const SidebarSearch: FC<SidebarSearchProps> = ({
|
|
contentType,
|
|
searchTerm,
|
|
setSearchTerm
|
|
}) => {
|
|
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Input
|
|
placeholder={t("side.searchPlaceholder", { contentType: t(`contentType.${contentType}`) })}
|
|
value={searchTerm}
|
|
onChange={e => setSearchTerm(e.target.value)}
|
|
/>
|
|
)
|
|
}
|