Skip to content

Commit dfb77dd

Browse files
frano-mclaude
andcommitted
refactor: consolidate common/table into @repo/shared/components/table (#1516)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b01d8eb commit dfb77dd

7 files changed

Lines changed: 10 additions & 9 deletions

File tree

  • app
    • components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/ReferenceAssemblyStep/components/AssemblyData/components/AssemblySelector/hooks/UseTable
    • views/OrganismView/components/Main/components
  • packages/shared/components/Table

app/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/ReferenceAssemblyStep/components/AssemblyData/components/AssemblySelector/hooks/UseTable/columnDef.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SelectCell } from "@/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/ReferenceAssemblyStep/components/AssemblyData/components/AssemblySelector/components/Table/components/TableCell/components/SelectCell/selectCell";
12
import {
23
buildNTagProps,
34
renderNTagCell,
4-
} from "@/components/common/Table/components/TableCell/components/NTagCell/utils";
5-
import { SelectCell } from "@/components/Entity/components/ConfigureWorkflowInputs/components/Main/components/Stepper/components/Step/ReferenceAssemblyStep/components/AssemblyData/components/AssemblySelector/components/Table/components/TableCell/components/SelectCell/selectCell";
5+
} from "@repo/shared/components/Table/components/TableCell/components/NTagCell/utils";
66
import { ColumnDef, SortingColumnDef } from "@tanstack/react-table";
77
import { getAssemblyIsolate, getAssemblySerotype } from "./accessorFn";
88
import { CATEGORY_CONFIGS } from "./categoryConfigs";

app/views/OrganismView/components/Main/components/AssembliesSection/assembliesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Table } from "@/components/common/Table/table";
21
import { StyledSectionTitle } from "@/views/OrganismView/components/Main/main.styles";
32
import { Toolbar } from "@/views/OrganismView/components/Main/table/components/Toolbar/toolbar";
43
import { useTable } from "@/views/OrganismView/components/Main/table/hooks/UseTable/hook";
@@ -7,6 +6,7 @@ import { ALERT_PROPS } from "@databiosphere/findable-ui/lib/components/common/Al
76
import { FluidPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/components/FluidPaper/fluidPaper";
87
import { TYPOGRAPHY_PROPS } from "@databiosphere/findable-ui/lib/styles/common/mui/typography";
98
import { Alert, Stack } from "@mui/material";
9+
import { Table } from "@repo/shared/components/Table/table";
1010
import { RowData } from "@tanstack/react-table";
1111
import { JSX } from "react";
1212
import { EmptyState } from "../EmptyState/emptyState";

app/views/OrganismView/components/Main/components/PangenomeSection/pangenomeSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Table } from "@/components/common/Table/table";
21
import { StyledSectionTitle } from "@/views/OrganismView/components/Main/main.styles";
32
import { useTable } from "@/views/OrganismView/components/Main/table/hooks/UseTable/hook";
43
import { useShowPangenome } from "@/views/OrganismView/hooks/UseShowPangenome/hook";
@@ -13,6 +12,7 @@ import {
1312
Toolbar,
1413
Typography,
1514
} from "@mui/material";
15+
import { Table } from "@repo/shared/components/Table/table";
1616
import { JSX } from "react";
1717
import { StyledFluidPaper } from "./pangenomeSection.styles";
1818
import { COLUMNS } from "./table/columns";

app/components/common/Table/components/TableCell/components/NTagCell/utils.tsx renamed to packages/shared/components/Table/components/TableCell/components/NTagCell/utils.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NTagCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell";
2-
import { CellContext, RowData } from "@tanstack/react-table";
3-
import { ComponentProps, JSX } from "react";
2+
import type { CellContext, RowData } from "@tanstack/react-table";
3+
import type { ComponentProps } from "react";
4+
import { JSX } from "react";
45

56
/**
67
* Builds props for NTagCell component.

app/components/common/Table/hooks/UseRowDirection/hook.ts renamed to packages/shared/components/Table/hooks/UseRowDirection/hook.ts

File renamed without changes.

app/components/common/Table/table.tsx renamed to packages/shared/components/Table/table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { useVirtualization } from "@databiosphere/findable-ui/lib/components/Tab
44
import { GridTable } from "@databiosphere/findable-ui/lib/components/Table/table.styles";
55
import { getColumnTrackSizing } from "@databiosphere/findable-ui/lib/components/TableCreator/options/columnTrackSizing/utils";
66
import { TableContainer } from "@mui/material";
7-
import { RowData } from "@tanstack/react-table";
7+
import type { RowData } from "@tanstack/react-table";
88
import { JSX } from "react";
99
import { useRowDirection } from "./hooks/UseRowDirection/hook";
10-
import { Props } from "./types";
10+
import type { Props } from "./types";
1111

1212
/**
1313
* Renders a virtualized table for a TanStack Table instance, with responsive
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RowData, Table } from "@tanstack/react-table";
1+
import type { RowData, Table } from "@tanstack/react-table";
22

33
export interface Props<T extends RowData> {
44
table: Table<T>;

0 commit comments

Comments
 (0)