"use client"; import { AnimatePresence, motion } from "motion/react"; import { type ReactNode, use } from "react"; import { TabListStateContext } from "react-aria-components"; import { TabPanel as UnstyledTabPanel } from "../unstyled/Tabs/index.js"; const AnimatedPanel = motion(UnstyledTabPanel); type Props = { items: { id: string; children: ReactNode; }[]; }; export const CrossfadeTabPanels = ({ items }: Props) => { const state = use(TabListStateContext); return ( {state && ( item.id === state.selectedKey)} /> )} ); };