"use client" import type { Children, Classname } from "@/core/types/common"; import { useEffect, useRef, useState } from "react"; import Image from "next/image"; interface OptionWrapperProps extends Children, Classname { title: string; subtitle: string; contentClassName?: string; headerClassName?: string; defaultExpanded?: boolean; updateTrigger?: any[]; // it's actually the useEffect deps, so it could be anything! } export default function OptionWrapper(props: Readonly): JSX.Element { const content = useRef(null); const [scrollHeight, setScrollHeight] = useState(0); const [isExpanded, setExpanded] = useState(props.defaultExpanded || false); const expandHandler = () => { setExpanded(p => !p) } useEffect(() => { if (content.current) { setScrollHeight(content.current.scrollHeight); } }, [props.updateTrigger || undefined]); return (

{props.title} {props.subtitle}

{"expand_more_bottom"}
{props.children}
); }