feat(mcp): подготовить сервер и доступ к приёмке
This commit is contained in:
commit
bf3d50e1ff
3835 files changed
+537122
No files matched your search
@@ -0,0 +1,70 @@
|
||||
"use client"
|
||||
|
||||
import type { ReactNode } from "react"
|
||||
import type { Table } from "@tanstack/react-table"
|
||||
import { DATA_GRID_LABELS_RU } from "@/lib/data-grid-labels-ru"
|
||||
import {
|
||||
DataGrid,
|
||||
DataGridContainer,
|
||||
DataGridPagination,
|
||||
DataGridTable,
|
||||
type DataGridProps,
|
||||
type DataGridFeatures,
|
||||
} from "@/components/reui/data-grid"
|
||||
import {
|
||||
DATA_GRID_CONTAINER_CLASS,
|
||||
DEFAULT_DATA_GRID_CLASS_NAMES,
|
||||
DEFAULT_DATA_GRID_LAYOUT,
|
||||
} from "@/components/data-grids/shared/data-grid-layout"
|
||||
|
||||
interface DataGridShellProps<TData extends object> {
|
||||
table: Table<DataGridFeatures, TData>
|
||||
recordCount: number
|
||||
children?: ReactNode
|
||||
pagination?: boolean
|
||||
isLoading?: boolean
|
||||
loadingMode?: DataGridProps<DataGridFeatures, TData>["loadingMode"]
|
||||
emptyMessage?: ReactNode
|
||||
onRowClick?: DataGridProps<DataGridFeatures, TData>["onRowClick"]
|
||||
tableLayout?: DataGridProps<DataGridFeatures, TData>["tableLayout"]
|
||||
tableClassNames?: DataGridProps<DataGridFeatures, TData>["tableClassNames"]
|
||||
}
|
||||
|
||||
function DataGridShell<TData extends object>({
|
||||
table,
|
||||
recordCount,
|
||||
children,
|
||||
pagination = false,
|
||||
isLoading,
|
||||
loadingMode,
|
||||
emptyMessage,
|
||||
onRowClick,
|
||||
tableLayout = DEFAULT_DATA_GRID_LAYOUT,
|
||||
tableClassNames = DEFAULT_DATA_GRID_CLASS_NAMES,
|
||||
}: DataGridShellProps<TData>) {
|
||||
return (
|
||||
<DataGrid
|
||||
className="w-full"
|
||||
i18n={{ labels: DATA_GRID_LABELS_RU }}
|
||||
table={table}
|
||||
recordCount={recordCount}
|
||||
isLoading={isLoading}
|
||||
loadingMode={loadingMode}
|
||||
emptyMessage={emptyMessage}
|
||||
onRowClick={onRowClick}
|
||||
tableLayout={tableLayout}
|
||||
tableClassNames={tableClassNames}
|
||||
>
|
||||
{children ?? (
|
||||
<DataGridContainer border={false} className={DATA_GRID_CONTAINER_CLASS}>
|
||||
<DataGridTable />
|
||||
</DataGridContainer>
|
||||
)}
|
||||
{pagination && recordCount > 0 && (
|
||||
<DataGridPagination className="px-5 pb-3" />
|
||||
)}
|
||||
</DataGrid>
|
||||
)
|
||||
}
|
||||
|
||||
export { DataGridShell, type DataGridShellProps }
|
||||
Reference in new issue
Block a user