'use client' import { Tab } from '@headlessui/react' import { AnimatePresence, motion } from 'framer-motion' import { useEffect, useState } from 'react' import { cn } from '@/lib/utils' import { Container } from './Container' import { useTranslations } from 'next-intl' const features = [ { title: 'primaryFeatures.projects', description: 'primaryFeatures.projectsDes', image: '/primary/projects.png', }, { title: 'primaryFeatures.applications', description: 'primaryFeatures.applicationsDes', image: '/primary/applications.png', }, { title: 'primaryFeatures.compose', description: 'primaryFeatures.composeDes', image: '/primary/compose.png', }, { title: 'primaryFeatures.multinode', description: 'primaryFeatures.multinodeDes', image: '/primary/multinode.png', }, { title: 'primaryFeatures.monitoring', description: 'primaryFeatures.monitoringDes', image: '/primary/monitoring.png', }, { title: 'primaryFeatures.backups', description: 'primaryFeatures.backupsDes', image: '/primary/backups.png', }, ] export function PrimaryFeatures() { const t = useTranslations('HomePage') const [tabOrientation, setTabOrientation] = useState< 'horizontal' | 'vertical' >('horizontal') useEffect(() => { const lgMediaQuery = window.matchMedia('(min-width: 1024px)') function onMediaQueryChange({ matches }: { matches: boolean }) { setTabOrientation(matches ? 'vertical' : 'horizontal') } onMediaQueryChange(lgMediaQuery) lgMediaQuery.addEventListener('change', onMediaQueryChange) return () => { lgMediaQuery.removeEventListener('change', onMediaQueryChange) } }, []) const [isMounted, setIsMounted] = useState(false) // Cambiar isMounted a true después del primer render useEffect(() => { setIsMounted(true) }, []) return (
{/*
*/} {/* */}

{t('primaryFeatures.title')}

{t('primaryFeatures.des')}

{({ selectedIndex }) => ( <>
{features.map((feature, featureIndex) => ( {selectedIndex === featureIndex && ( )}

{t(feature.title)}

))}
{features.map((feature, index) => (

{t(feature.description)}

))} )}
) }