mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-23 20:37:42 +02:00
refactor item list to use accessor function
This commit is contained in:
@@ -18,9 +18,8 @@ import { stringToColor } from '/@/shared/utils/string-to-color';
|
||||
const MAX_GENRES = 4;
|
||||
|
||||
const GenreBadgeColumn = (props: ItemTableListInnerColumn) => {
|
||||
const row: Genre[] | undefined = (props.data as (Genre[] | undefined)[])[props.rowIndex]?.[
|
||||
'genres'
|
||||
];
|
||||
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
|
||||
const row: Genre[] | undefined = (rowItem as any)?.genres;
|
||||
|
||||
const genres = useMemo(() => {
|
||||
if (!row) return [];
|
||||
|
||||
Reference in New Issue
Block a user