"use client"; /* eslint-disable react-hooks/set-state-in-effect */ import { useState, useEffect, type FC, useId } from "react"; import { motion, LayoutGroup } from "framer-motion"; /* ---------- Types ---------- */ interface TabItem { id: string; label: string; } interface ContinuousTabsProps { tabs?: TabItem[]; activeId?: string; defaultActiveId?: string; onChange?: (id: string) => void; size?: "sm" | "md"; layoutId?: string; } /* ---------- Defaults ---------- */ const DEFAULT_TABS: TabItem[] = [ { id: "home", label: "Home" }, { id: "interactions", label: "Interactions" }, { id: "resources", label: "Resources" }, { id: "docs", label: "Docs" }, ]; export const ContinuousTabs: FC = ({ tabs = DEFAULT_TABS, activeId, defaultActiveId = "home", onChange, size = "md", layoutId, }) => { const [activeState, setActiveState] = useState(defaultActiveId); const [isMounted, setIsMounted] = useState(false); const uniqueId = useId(); useEffect(() => { setIsMounted(true); }, []); const active = activeId !== undefined ? activeId : activeState; const finalLayoutId = layoutId ?? `active-pill-${uniqueId}`; const handleChange = (id: string) => { setActiveState(id); onChange?.(id); }; if (!isMounted) return null; const isSm = size === "sm"; return ( ); };