import clsx from 'clsx';
import styles from './row-index-column.module.css';
import {
ItemTableListInnerColumn,
TableColumnContainer,
TableColumnTextContainer,
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
import { ItemListItem } from '/@/renderer/components/item-list/types';
import { usePlayerStatus } from '/@/renderer/store';
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
import { Flex } from '/@/shared/components/flex/flex';
import { Icon } from '/@/shared/components/icon/icon';
import { Text } from '/@/shared/components/text/text';
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
import { PlayerStatus } from '/@/shared/types/types';
export const RowIndexColumn = (props: ItemTableListInnerColumn) => {
const { itemType } = props;
switch (itemType) {
case LibraryItem.QUEUE_SONG:
return ;
default:
return ;
}
};
const DefaultRowIndexColumn = (props: ItemTableListInnerColumn) => {
const {
adjustedRowIndexMap,
controls,
data,
enableExpansion,
enableHeader,
internalState,
itemType,
rowIndex,
} = props;
const adjustedRowIndex =
adjustedRowIndexMap?.get(rowIndex) ?? (enableHeader ? rowIndex : rowIndex + 1);
if (enableExpansion) {
return (
controls.onExpand?.({
event: e,
internalState,
item: data[rowIndex] as ItemListItem,
itemType,
})
}
size="xs"
variant="subtle"
/>
{adjustedRowIndex}
);
}
return {adjustedRowIndex};
};
const QueueSongRowIndexColumn = (props: ItemTableListInnerColumn) => {
const status = usePlayerStatus();
const song = props.data[props.rowIndex] as QueueSong;
const isActive = props.activeRowId === song?._uniqueId;
const adjustedRowIndex =
props.adjustedRowIndexMap?.get(props.rowIndex) ??
(props.enableHeader ? props.rowIndex : props.rowIndex + 1);
return (
{isActive ? (
status === PlayerStatus.PLAYING ? (
) : (
)
) : (
adjustedRowIndex
)}
);
};