import Image, { type StaticImageData } from "next/image"; import { type ComponentProps, type ComponentType, type ReactNode, type SVGAttributes, useMemo, useRef, } from "react"; import { Tabs, TabList, Tab, TabPanel, Collection, } from "react-aria-components"; import { Faq } from "../Faq"; import { ModalDialog } from "../ModalDialog"; type Props = Omit, "title" | "children"> & { title: ReactNode; description: ReactNode; steps: { title: string; icon: ComponentType>; description: ReactNode; subTabs: { title: string; description: ReactNode; image: StaticImageData; }[]; faq: ComponentProps; }[]; }; export const Guide = ({ title, description, steps, ...props }: Props) => { const stepsWithIndices = useMemo( () => steps.map(({ subTabs, ...step }, index) => ({ ...step, subTabs: subTabs.map((subTab, subtabIndex) => ({ index: subtabIndex, ...subTab, })), index, })), [steps], ); const scrollTarget = useRef(null); return (
{description}
{({ title, icon: Icon, index }) => (
STEP {index + 1}
{title}
)}
{({ faq, index, title, description, subTabs }) => (

{title}

{description}
{({ title, index: subtabIndex }) => ( {title} )} {({ title, description, image, index: subtabIndex }) => (

{title}

{description}
)}
)}
); };