This commit is contained in:
Marc Abramowitz 2025-04-24 00:53:56 -07:00 committed by GitHub
commit d8a6243b23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View file

@ -450,6 +450,8 @@ export function AllKeysTable({
columns={columns.filter(col => col.id !== 'expander') as any} columns={columns.filter(col => col.id !== 'expander') as any}
data={filteredKeys as any} data={filteredKeys as any}
isLoading={isLoading} isLoading={isLoading}
loadingMessage="🚅 Loading keys..."
noDataMessage="No keys found"
getRowCanExpand={() => false} getRowCanExpand={() => false}
renderSubComponent={() => <></>} renderSubComponent={() => <></>}
/> />

View file

@ -26,6 +26,8 @@ function DataTableWrapper({
isLoading={isLoading} isLoading={isLoading}
renderSubComponent={renderSubComponent} renderSubComponent={renderSubComponent}
getRowCanExpand={getRowCanExpand} getRowCanExpand={getRowCanExpand}
loadingMessage="🚅 Loading tools..."
noDataMessage="No tools found"
/> />
); );
} }

View file

@ -26,6 +26,8 @@ interface DataTableProps<TData, TValue> {
expandedRequestId?: string | null; expandedRequestId?: string | null;
onRowExpand?: (requestId: string | null) => void; onRowExpand?: (requestId: string | null) => void;
setSelectedKeyIdInfoView?: (keyId: string | null) => void; setSelectedKeyIdInfoView?: (keyId: string | null) => void;
loadingMessage?: string;
noDataMessage?: string;
} }
export function DataTable<TData extends { request_id: string }, TValue>({ export function DataTable<TData extends { request_id: string }, TValue>({
@ -36,6 +38,8 @@ export function DataTable<TData extends { request_id: string }, TValue>({
isLoading = false, isLoading = false,
expandedRequestId, expandedRequestId,
onRowExpand, onRowExpand,
loadingMessage = "🚅 Loading logs...",
noDataMessage = "No logs found",
}: DataTableProps<TData, TValue>) { }: DataTableProps<TData, TValue>) {
const table = useReactTable({ const table = useReactTable({
data, data,
@ -114,7 +118,7 @@ export function DataTable<TData extends { request_id: string }, TValue>({
<TableRow> <TableRow>
<TableCell colSpan={columns.length} className="h-8 text-center"> <TableCell colSpan={columns.length} className="h-8 text-center">
<div className="text-center text-gray-500"> <div className="text-center text-gray-500">
<p>🚅 Loading logs...</p> <p>{loadingMessage}</p>
</div> </div>
</TableCell> </TableCell>
</TableRow> </TableRow>
@ -147,7 +151,7 @@ export function DataTable<TData extends { request_id: string }, TValue>({
: <TableRow> : <TableRow>
<TableCell colSpan={columns.length} className="h-8 text-center"> <TableCell colSpan={columns.length} className="h-8 text-center">
<div className="text-center text-gray-500"> <div className="text-center text-gray-500">
<p>No logs found</p> <p>{noDataMessage}</p>
</div> </div>
</TableCell> </TableCell>
</TableRow> </TableRow>