zeed-dynamic-table
Version:
A flexible and dynamic table component for React and Next.js applications without Tailwind dependencies
25 lines (24 loc) • 1.01 kB
TypeScript
import { ReactNode } from "react";
import { ColumnType, TopContentOptionsType } from "../types";
/**
* Renders a cell value based on column configuration
* Improved error handling and type safety
*/
declare function renderValue<T>(column: ColumnType<keyof T & string>, item: T): ReactNode;
/**
* Renders appropriate cell content based on column configuration
* Improved error handling and type safety
*/
declare function celValue<T>(column: ColumnType<keyof T & string>, colIndex: number, item: T, cellKey?: string): ReactNode;
/**
* Detect if dark mode is enabled by checking for a CSS class on the html element
* or checking for prefers-color-scheme
*/
declare function isDarkMode(): boolean;
/**
* Renders table top content (search, buttons, etc.)
* Improved error handling
*/
declare function renderTopContent(topContent?: ReactNode, topContentOptions?: TopContentOptionsType): ReactNode;
export { celValue, renderValue, renderTopContent, isDarkMode };
export type { TopContentOptionsType };