import { AnimatePresence } from 'framer-motion'; import { useState } from 'react'; import { indexElements } from '@/lib/index/data'; import IndexIphoneFrame from '@/components/instance/IndexIphoneFrame'; import WindowFrame from '@/components/WindowFrame'; function IndexDemoWindow() { const [selected, setSelected] = useState('Card'); const selectedStyle = (item) => { return selected === item ? `text-gray-900 dark:text-gray-800 bg-white dark:bg-gray-300 shadow` : `text-gray-500/80 dark:text-gray-400 contrast-more:text-gray-600 dark:contrast-more:text-gray-300 hover:text-gray-600 dark:hover:text-gray-100 hover:bg-gray-50/80 dark:hover:bg-gray-300/10 focus:text-gray-600 dark:focus:text-gray-100 focus:bg-gray-50/80 dark:focus:bg-gray-300/10`; }; const selectedComponent = (selected) => { let match = []; indexElements.forEach( (item) => (match = match.concat( item.lists.filter((list) => list.name === selected) )) ); return match[0]?.component; }; const selectionBody = indexElements.map((item) => ( )); return ( <> {selectedComponent(selected)} } /> ); } export default IndexDemoWindow;