mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
rename: rename table components
This commit is contained in:
@@ -3,12 +3,12 @@ import { Suspense } from "react";
|
||||
|
||||
import { getProvider } from "@/actions";
|
||||
import { FilterControls } from "@/components/filters";
|
||||
import { AddProviderModal } from "@/components/providers";
|
||||
import {
|
||||
AddProviderModal,
|
||||
ColumnsProvider,
|
||||
DataTableProvider,
|
||||
SkeletonTableProvider,
|
||||
} from "@/components/providers";
|
||||
} from "@/components/providers/table";
|
||||
import { Header } from "@/components/ui";
|
||||
import { SearchParamsProps } from "@/types";
|
||||
|
||||
|
||||
@@ -8,8 +8,3 @@ export * from "./forms/DeleteForm";
|
||||
export * from "./ProviderInfo";
|
||||
export * from "./ScanStatus";
|
||||
export * from "./SnippetIdProvider";
|
||||
export * from "./table/ColumnsProvider";
|
||||
export * from "./table/DataTableColumnHeader";
|
||||
export * from "./table/DataTablePagination";
|
||||
export * from "./table/DataTableProvider";
|
||||
export * from "./table/SkeletonTableProvider";
|
||||
|
||||
+1
-1
@@ -9,8 +9,8 @@ import { ProviderProps } from "@/types";
|
||||
import { DateWithTime } from "../DateWithTime";
|
||||
import { ProviderInfo } from "../ProviderInfo";
|
||||
import { SnippetIdProvider } from "../SnippetIdProvider";
|
||||
import { DataTableColumnHeader } from "./data-table-column-header";
|
||||
import { DataTableRowActions } from "./data-table-row-actions";
|
||||
import { DataTableColumnHeader } from "./DataTableColumnHeader";
|
||||
|
||||
const getProviderData = (row: { original: ProviderProps }) => {
|
||||
return row.original;
|
||||
+4
-2
@@ -1,12 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@nextui-org/react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { useCallback, useMemo } from "react";
|
||||
|
||||
interface FilterColumnTableProps {
|
||||
interface DataTableFilterCustomProps {
|
||||
filters: { key: string; values: string[] }[];
|
||||
}
|
||||
|
||||
export function FilterColumnTable({ filters }: FilterColumnTableProps) {
|
||||
export function DataTableFilterCustom({ filters }: DataTableFilterCustomProps) {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
+4
-4
@@ -23,8 +23,8 @@ import {
|
||||
} from "@/components/ui";
|
||||
import { MetaDataProps } from "@/types";
|
||||
|
||||
import { DataTablePagination } from "./DataTablePagination";
|
||||
import { FilterColumnTable } from "./FilterColumnTable";
|
||||
import { DataTableFilterCustom } from "./data-table-filter-custom";
|
||||
import { DataTablePagination } from "./data-table-pagination";
|
||||
|
||||
interface DataTableProviderProps<TData, TValue> {
|
||||
columns: ColumnDef<TData, TValue>[];
|
||||
@@ -56,7 +56,7 @@ export function DataTableProvider<TData, TValue>({
|
||||
});
|
||||
|
||||
// This will be used to have "custom" filters in the table and will be
|
||||
// passed to the FilterColumnTable component. This needs to be dynamic
|
||||
// passed to the DataTableFilterCustom component. This needs to be dynamic
|
||||
// based on the columns that are available in the table.
|
||||
|
||||
const filters = [
|
||||
@@ -67,7 +67,7 @@ export function DataTableProvider<TData, TValue>({
|
||||
|
||||
return (
|
||||
<>
|
||||
<FilterColumnTable filters={filters} />
|
||||
<DataTableFilterCustom filters={filters} />
|
||||
<div className="rounded-md border w-full">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
@@ -0,0 +1,7 @@
|
||||
export { ColumnsProvider } from "./columns-provider";
|
||||
export { DataTableColumnHeader } from "./data-table-column-header";
|
||||
export { DataTableFilterCustom } from "./data-table-filter-custom";
|
||||
export { DataTablePagination } from "./data-table-pagination";
|
||||
export { DataTableProvider } from "./data-table-provider";
|
||||
export { DataTableRowActions } from "./data-table-row-actions";
|
||||
export { SkeletonTableProvider } from "./skeleton-table-provider";
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "@tanstack/react-table";
|
||||
import { useState } from "react";
|
||||
|
||||
import { DataTablePagination } from "@/components/providers";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -22,6 +21,8 @@ import {
|
||||
} from "@/components/ui";
|
||||
import { MetaDataProps } from "@/types";
|
||||
|
||||
import { DataTablePagination } from "./DataTablePagination";
|
||||
|
||||
interface DataTableUserProps<TData, TValue> {
|
||||
columns: ColumnDef<TData, TValue>[];
|
||||
data: TData[];
|
||||
|
||||
Reference in New Issue
Block a user