"use client"; import { type CSSProperties, type ReactNode, useRef } from "react"; import { useInView } from "@/app/hooks/useInView"; import { DrawLine } from "./animations/DrawLine"; import { TextDiffuseReveal } from "./animations/TextDiffuseReveal"; import { Reveal } from "./Reveal"; interface SectionProps { id?: string; eyebrow?: string; title: string; description?: string; dark?: boolean; aside?: ReactNode; children: ReactNode; disableChildrenAnimation?: boolean; } /** Atraso (s) de cada item do cabeçalho: entram em escada, como a linha que se desenha logo depois. */ const stagger = (seconds: number) => ({ "--reveal-delay": `${seconds}s` }) as CSSProperties; export const Section = ({ id, eyebrow, title, description, dark, aside, children, disableChildrenAnimation = false, }: SectionProps) => { const headerRef = useRef(null); const headerShown = useInView(headerRef); const baseClass = dark ? "ds-section ds-section-dark" : "ds-section"; return (
{eyebrow && (

{eyebrow}

)}

{description && (

{description}

)}
{/*
, não
{!disableChildrenAnimation ? (
{children}
) : (
{children}
)}
); };