import React from 'react'; import { IonSearchbar } from '@ionic/react'; import { InfiniteScrollList, SongItem } from '../../components/common'; import { useSearch, useDebugLogging } from '../../hooks'; import { useAppSelector } from '../../redux'; import { selectIsAdmin, selectSongs } from '../../redux'; import type { Song } from '../../types'; import { SongItemContext } from '../../types'; const Search: React.FC = () => { const { searchTerm, searchResults, handleSearchChange, loadMore, } = useSearch(); const isAdmin = useAppSelector(selectIsAdmin); const songs = useAppSelector(selectSongs); const songsCount = Object.keys(songs).length; // Use unified debug logging const { logData } = useDebugLogging({ componentName: 'Search' }); // Log component data logData({ 'songs count': songsCount, 'search results': searchResults, 'search term': searchTerm, 'showing': `${searchResults.songs.length} of ${searchResults.count}`, }); return ( <>