Skip to content

Commit

Permalink
feat(DataTableSearch): add placeholder to api
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeirojose committed Apr 30, 2024
1 parent f78ef1e commit 152766d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/DataTable/DataTableSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Input } from "#/components/ui";

import { useTableContext } from "./TableContext";

export function DataTableSearch({ searchKey = "name" }) {
export function DataTableSearch({ searchKey = "name", placeholder = null }) {
// @ts-expect-error TS(2339) FIXME: Property 'table' does not exist on type '{}'.
const { table, searchKey: TableSeachKey } = useTableContext();

Expand All @@ -15,7 +15,7 @@ export function DataTableSearch({ searchKey = "name" }) {

return (
<Input
placeholder={t("Search")}
placeholder={placeholder || t("Search")}
value={table.getColumn(search)?.getFilterValue() ?? ""}
onChange={(event) =>
table.getColumn(search)?.setFilterValue(event.target.value)
Expand Down

0 comments on commit 152766d

Please sign in to comment.