mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-21 10:50:16 -04:00
cleaned up imports
This commit is contained in:
parent
2766ad8eee
commit
5d06760c41
|
@ -1,34 +1,14 @@
|
||||||
// for showcasing to compass
|
import { Row, ColumnDef, useReactTable, getCoreRowModel, flexRender } from "@tanstack/react-table";
|
||||||
import {
|
|
||||||
Cell,
|
|
||||||
ColumnDef,
|
|
||||||
Row,
|
|
||||||
createColumnHelper,
|
|
||||||
flexRender,
|
|
||||||
getCoreRowModel,
|
|
||||||
getFilteredRowModel,
|
|
||||||
sortingFns,
|
|
||||||
useReactTable,
|
|
||||||
} from "@tanstack/react-table";
|
|
||||||
import {
|
import {
|
||||||
ChangeEvent,
|
ChangeEvent,
|
||||||
useState,
|
useState,
|
||||||
useEffect,
|
useEffect,
|
||||||
FunctionComponent,
|
|
||||||
useRef,
|
|
||||||
ChangeEventHandler,
|
|
||||||
Key,
|
Key,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { RowOptionMenu } from "./RowOptionMenu";
|
|
||||||
import { RowOpenAction } from "./RowOpenAction";
|
|
||||||
import { TableAction } from "./TableAction";
|
import { TableAction } from "./TableAction";
|
||||||
import {
|
import {
|
||||||
AtSymbolIcon,
|
|
||||||
Bars2Icon,
|
|
||||||
ArrowDownCircleIcon,
|
|
||||||
PlusIcon,
|
PlusIcon,
|
||||||
} from "@heroicons/react/24/solid";
|
} from "@heroicons/react/24/solid";
|
||||||
import TagsInput from "../TagsInput/Index";
|
|
||||||
import { rankItem } from "@tanstack/match-sorter-utils";
|
import { rankItem } from "@tanstack/match-sorter-utils";
|
||||||
import Resource from "@/utils/models/Resource";
|
import Resource from "@/utils/models/Resource";
|
||||||
|
|
||||||
|
@ -49,8 +29,7 @@ const fuzzyFilter = (
|
||||||
return itemRank.passed;
|
return itemRank.passed;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Rename everything to resources
|
export const Table = ({ initialData, columns }: { initialData: Resource[], columns: ColumnDef<any, any>[] }) => {
|
||||||
export const TestTable = ({ initialData, columns }: { initialData: Resource[], columns: ColumnDef<any, any>[] }) => {
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const sortedData = [...initialData].sort((a, b) =>
|
const sortedData = [...initialData].sort((a, b) =>
|
||||||
a.visible === b.visible ? 0 : a.visible ? -1 : 1
|
a.visible === b.visible ? 0 : a.visible ? -1 : 1
|
||||||
|
@ -76,9 +55,6 @@ export const TestTable = ({ initialData, columns }: { initialData: Resource[], c
|
||||||
|
|
||||||
// TODO: Sorting
|
// TODO: Sorting
|
||||||
|
|
||||||
// added this fn for editing rows
|
|
||||||
|
|
||||||
|
|
||||||
const table = useReactTable({
|
const table = useReactTable({
|
||||||
columns,
|
columns,
|
||||||
data,
|
data,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user