create mapped union type

This commit is contained in:
Nate Kelley 2025-08-02 23:00:42 -06:00
parent 8eb1b276fd
commit fd377cbfa2
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 13 additions and 11 deletions

View File

@ -14,16 +14,18 @@ export interface BusterListProps<T = any> {
rowClassName?: string;
}
export interface BusterListColumn<T = any> {
dataIndex: keyof T;
title: string;
width?: number;
minWidth?: number;
align?: 'left' | 'center' | 'right'; //TODO
render?: (value: T[keyof T], record: T) => React.JSX.Element | string | React.ReactNode;
headerRender?: (title: string) => React.ReactNode;
ellipsis?: boolean;
}
export type BusterListColumn<T> = {
[K in keyof T]: {
dataIndex: K;
title: string;
width?: number;
minWidth?: number;
align?: 'left' | 'center' | 'right';
render?: (value: T[K], record: T) => React.JSX.Element | string | React.ReactNode;
headerRender?: (title: string) => React.ReactNode;
ellipsis?: boolean;
};
}[keyof T];
export type BusterListRow = BusterListRowItem;
export interface BusterListRowItem {

View File

@ -60,7 +60,7 @@ export const ReportItemsContainer: React.FC<{
{
dataIndex: 'name',
title: 'Name',
render: (name, record) => <TitleCell name={record.name} chatId={record?.id} />
render: (name, record) => <TitleCell name={name} chatId={record?.id} />
},
{
dataIndex: 'last_edited',