"use client"; import { cn } from "@/lib/utils"; import { Header } from "@/components/layout/Header/Header"; import Typography, { TypographyProps, } from "@/components/ui/Typography/Typography"; import { BottomActionButton, BottomActionButtonProps, } from "@/components/widgets/BottomActionButton/BottomActionButton"; import { useEffect, useRef, useState } from "react"; export interface LayoutQuestionProps extends Omit, "title" | "content"> { headerProps?: React.ComponentProps; title: TypographyProps<"h2">; subtitle: TypographyProps<"p">; children: React.ReactNode; bottomActionButtonProps?: BottomActionButtonProps; } function LayoutQuestion({ className, headerProps, title, subtitle, children, bottomActionButtonProps, ...props }: LayoutQuestionProps) { const bottomActionButtonRef = useRef(null); const [bottomActionButtonHeight, setBottomActionButtonHeight] = useState(132); useEffect(() => { if (bottomActionButtonRef.current) { console.log(bottomActionButtonRef.current.clientHeight); setBottomActionButtonHeight(bottomActionButtonRef.current.clientHeight); } }, [bottomActionButtonProps]); return (
{title && ( )} {subtitle && ( )} {children} {bottomActionButtonProps && ( )}
); } export { LayoutQuestion };