import { useCallback, useState } from 'react';

export type StreamViewMode = 'player' | 'list';

export function useStreamViewMode(): {
  mode: StreamViewMode;
  toggle: () => void;
} {
  const [mode, setMode] = useState<StreamViewMode>('player');
  const toggle = useCallback(() => {
    setMode((prev) => (prev === 'player' ? 'list' : 'player'));
  }, []);

  return { mode, toggle };
}
