/** * Client-side component for displaying asset data in a table format. * Uses React Query for data fetching and caching. */ 'use client'; import { DataTable } from '@/components/blocks/data-table/data-table'; import type { AssetDetailConfig } from '@/lib/config/assets'; import type { QueryKey } from '@tanstack/react-query'; import { useSuspenseQuery } from '@tanstack/react-query'; import type { useReactTable } from '@tanstack/react-table'; import type { LucideIcon } from 'lucide-react'; import type { ComponentType } from 'react'; export type AssetTableClientProps = { assetConfig: AssetDetailConfig; dataAction: () => Promise; refetchInterval?: number; /** Map of icon components to be used in the table */ icons?: Record | LucideIcon>; /** Column definitions for the table */ columns: Parameters>[0]['columns']; queryKey: QueryKey; }; /** * Client-side table component for displaying asset data * @template Asset - The type of asset data being displayed */ export function AssetTableClient>({ dataAction, assetConfig, refetchInterval, columns, icons, queryKey, }: AssetTableClientProps) { const { data } = useSuspenseQuery({ queryKey, queryFn: () => dataAction(), refetchInterval, }); return ; }