'use client'; import { TemplateProps } from '@/lib/contracts/components/ComponentContracts'; import type { LeagueDetailViewData } from '@/lib/view-data/LeagueDetailViewData'; import { Box } from '@/ui/Box'; import { Container } from '@/ui/Container'; import { Icon } from '@/ui/Icon'; import { Link } from '@/ui/Link'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; import { ChevronRight } from 'lucide-react'; import { usePathname } from 'next/navigation'; export function LeagueDetailTemplate({ viewData, children, tabs }: TemplateProps & { children?: React.ReactNode, tabs?: any[] }) { const pathname = usePathname(); return ( Leagues {viewData.name} {/* Tabs */} {tabs && tabs.length > 0 && ( {tabs.map((tab) => { const isActive = tab.exact ? pathname === tab.href : pathname.startsWith(tab.href); return ( {tab.label} ); })} )} {children} ); }