fix(ui): перенести таблицы оптимизатора маршрутов на ReUI v9

This commit is contained in:
Denozordec committed 2026-09-14 22:01:11 +07:00
1 parent 1ea07f65b2
commit bdba83b2b6
6 files changed
+132 -45

No files matched your search

@@ -1,22 +1,22 @@
"use client"
import { dataGridFeatures, type DataGridFeatures } from "@/components/reui/data-grid"
import { useMemo } from "react"
import {
type ColumnDef,
getCoreRowModel,
getSortedRowModel,
useReactTable,
} from "@tanstack/react-table-v8"
useTable,
} from "@tanstack/react-table"
import type { CommRec } from "@/lib/route-optimizer-data"
import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import { DataGridShell } from "@/components/data-grids/shared/legacy-data-grid-shell"
import { DataGridShell } from "@/components/data-grids/shared/data-grid-shell"
import {
DATA_GRID_CELL_PAD,
DATA_GRID_CELL_PAD_FIRST,
DATA_GRID_CELL_PAD_LAST,
} from "@/components/data-grids/shared/legacy-data-grid-layout"
import { DataGridSortHeader } from "@/components/data-grids/shared/legacy-data-grid-sort-header"
} from "@/components/data-grids/shared/data-grid-layout"
import { DataGridSortHeader } from "@/components/data-grids/shared/data-grid-sort-header"
import { ArrowRightIcon, PinIcon, RefreshCwIcon } from "lucide-react"
function Chip({ children, color }: { children: React.ReactNode; color?: string }) {
@@ -70,7 +70,7 @@ function RouteOptimizerCommRecsDataGrid({
[homeId, recs],
)
const columns = useMemo<ColumnDef<(typeof rows)[number]>[]>(
const columns = useMemo<ColumnDef<DataGridFeatures, (typeof rows)[number]>[]>(
() => [
{
id: "community",
@@ -231,11 +231,11 @@ function RouteOptimizerCommRecsDataGrid({
[applied, applying, homeId, onApply, onPin, pinned],
)
const table = useReactTable({
const table = useTable({
features: dataGridFeatures,
manualPagination: true,
data: rows,
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getRowId: (row) => row._rowKey,
})