feat(dashboard): DataTable component (#6297)

This commit is contained in:
Kasper Fabricius Kristensen
2024-02-02 21:56:55 +01:00
committed by GitHub
parent a7be5d7b6d
commit 8cbf6c60fe
62 changed files with 2722 additions and 397 deletions

View File

@@ -0,0 +1,32 @@
import { Filter } from ".."
import { DataTableFilter } from "../data-table-filter"
import { DataTableOrderBy } from "../data-table-order-by"
import { DataTableSearch } from "../data-table-search"
export interface DataTableQueryProps {
search?: boolean
orderBy?: (string | number)[]
filters?: Filter[]
prefix?: string
}
export const DataTableQuery = ({
search,
orderBy,
filters,
prefix,
}: DataTableQueryProps) => {
return (
<div className="flex items-start justify-between gap-x-4 px-6 py-4">
<div className="w-full max-w-[60%]">
{filters && filters.length > 0 && (
<DataTableFilter filters={filters} prefix={prefix} />
)}
</div>
<div className="flex shrink-0 items-center gap-x-2">
{search && <DataTableSearch prefix={prefix} />}
{orderBy && <DataTableOrderBy keys={orderBy} prefix={prefix} />}
</div>
</div>
)
}

View File

@@ -0,0 +1 @@
export * from "./data-table-query"