import { useState, useEffect } from 'react'; import ResponseBlock from './ResponseBlock'; function useWindowWidth() { const [w, setW] = useState(typeof window !== 'undefined' ? window.innerWidth : 1200); useEffect(() => { const h = () => setW(window.innerWidth); window.addEventListener('resize', h); return () => window.removeEventListener('resize', h); }, []); return w; } export default function ResponseCarousel({ neonResponse, comparisonResponses, offset = 0, showPrePromptIndicator = false }) { const screenWidth = useWindowWidth(); const isMobile = screenWidth <= 480; const isTablet = screenWidth <= 900; const visible = isMobile ? 1 : (isTablet ? 1 : 2); const visibleComparisons = comparisonResponses.slice(offset, offset + visible); return (
{visibleComparisons.map((r, i) => ( ))} {comparisonResponses.length === 0 && (
No comparison models selected
)}
); }