import { useTrackList, UseTrackListOptions } from '../hooks/useTrackList';
import { TrackList } from './TrackList';

export interface TrackListContainerProps extends UseTrackListOptions {
  className?: string;
  emptyMessage?: string;
}

export function TrackListContainer({
  className,
  emptyMessage,
  ...options
}: TrackListContainerProps) {
  const { tracks, isLoading, error } = useTrackList({
    ...options,
    useService: true, // Container implies service usage primarily
    autoLoad: true,
  });

  if (error) {
    return (
      <div className="p-4 text-red-500">
        Error loading tracks: {error.message}
      </div>
    );
  }

  return (
    <TrackList
      tracks={tracks}
      isLoading={isLoading}
      emptyMessage={emptyMessage}
      className={className}
      // Pass other necessary handlers potentially
    />
  );
}
