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,23 +1,22 @@
"use client"
import { dataGridFeatures, type DataGridFeatures } from "@/components/reui/data-grid"
import { useMemo, useState } from "react"
import {
type ColumnDef,
getCoreRowModel,
getSortedRowModel,
useReactTable,
} from "@tanstack/react-table-v8"
useTable,
} from "@tanstack/react-table"
import type { FullRoute } from "@/lib/route-optimizer-data"
import { Flag } from "@/components/flag"
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, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
function Chip({ children, color }: { children: React.ReactNode; color?: string }) {
@@ -73,7 +72,7 @@ function RouteOptimizerFullRoutesDataGrid({
[visibleRoutes],
)
const columns = useMemo<ColumnDef<FullRoute & { _index: number }>[]>(
const columns = useMemo<ColumnDef<DataGridFeatures, FullRoute & { _index: number }>[]>(
() => [
{
id: "index",
@@ -249,11 +248,11 @@ function RouteOptimizerFullRoutesDataGrid({
[bestId],
)
const table = useReactTable({
const table = useTable({
features: dataGridFeatures,
manualPagination: true,
data: indexed,
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getRowId: (row) => row.id,
})