UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: стандартизация таблицы участников workspace

This commit is contained in:
DCCONSTRUCTIONS
2026-05-10 11:39:45 +03:00
parent 3dd99491a4
commit bf75ce84eb
6 changed files with 191 additions and 129 deletions
+9 -2
View File
@@ -29,7 +29,7 @@ export function Table<T>(props: TTableData<T>) {
<thead className={cn("divide-y divide-subtle", tHeadClassName)}>
<tr className={cn("divide-x divide-subtle text-13 text-primary", tHeadTrClassName)}>
{columns.map((column) => (
<th key={column.key} className={cn("px-2.5 py-2", thClassName)}>
<th key={column.key} className={cn("px-2.5 py-2", thClassName, column.thClassName)}>
{(column?.thRender && column?.thRender()) || column.content}
</th>
))}
@@ -42,7 +42,14 @@ export function Table<T>(props: TTableData<T>) {
className={cn("divide-x divide-subtle text-13 text-secondary", tBodyTrClassName)}
>
{columns.map((column) => (
<td key={`${column.key}-${keyExtractor(item)}`} className={cn("px-2.5 py-2", tdClassName)}>
<td
key={`${column.key}-${keyExtractor(item)}`}
className={cn(
"px-2.5 py-2",
tdClassName,
typeof column.tdClassName === "function" ? column.tdClassName(item) : column.tdClassName
)}
>
{column.tdRender(item)}
</td>
))}
+7 -3
View File
@@ -4,11 +4,15 @@
* See the LICENSE file for details.
*/
import type { ReactNode } from "react";
export type TTableColumn<T> = {
key: string;
content: string;
thRender?: () => React.ReactNode;
tdRender: (rowData: T) => React.ReactNode;
content: ReactNode;
thClassName?: string;
thRender?: () => ReactNode;
tdClassName?: string | ((rowData: T) => string);
tdRender: (rowData: T) => ReactNode;
};
export type TTableData<T> = {