import React from 'react';
import { IonHeader, IonToolbar, IonTitle, IonChip, IonIcon } from '@ionic/react';
import { time } from 'ionicons/icons';
import { InfiniteScrollList, SongItem } from '../../components/common';
import { useHistory } from '../../hooks';
import { useAppSelector } from '../../redux';
import { selectHistory } from '../../redux';
import { formatDate } from '../../utils/dataProcessing';
import type { Song } from '../../types';
const History: React.FC = () => {
const {
historyItems,
hasMore,
loadMore,
handleAddToQueue,
handleToggleFavorite,
} = useHistory();
const history = useAppSelector(selectHistory);
const historyCount = Object.keys(history).length;
// Debug logging
console.log('History component - history count:', historyCount);
console.log('History component - history items:', historyItems);
// Render extra content for history items (play date)
const renderExtraContent = (item: Song) => {
if (item.date) {
return (