"use client"; import React, { memo, useMemo } from "react"; import TimelinePhoneView from "@/components/cardStack/layouts/timelines/TimelinePhoneView"; import TextAnimation from "@/components/text/TextAnimation"; import Button from "@/components/button/Button"; import Tag from "@/components/shared/Tag"; import { cls } from "@/lib/utils"; import { getButtonProps } from "@/lib/buttonUtils"; import { useTheme } from "@/providers/themeProvider/ThemeProvider"; import type { LucideIcon } from "lucide-react"; import type { ButtonConfig, TitleSegment } from "@/components/cardStack/types"; import type { TimelinePhoneViewItem } from "@/components/cardStack/hooks/usePhoneAnimations"; import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; type AboutPhone = { imageAlt?: string; videoAriaLabel?: string; } & ( | { imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never } ); interface AboutPhoneTimelineProps { title: string; titleSegments?: TitleSegment[]; description: string; tag: string; tagIcon?: LucideIcon; buttons?: ButtonConfig[]; phoneOne: AboutPhone; phoneTwo: AboutPhone; textboxLayout: TextboxLayout; useInvertedBackground: InvertedBackground; ariaLabel?: string; className?: string; containerClassName?: string; desktopContainerClassName?: string; mobileContainerClassName?: string; desktopContentClassName?: string; desktopWrapperClassName?: string; mobileWrapperClassName?: string; phoneFrameClassName?: string; mobilePhoneFrameClassName?: string; titleImageWrapperClassName?: string; titleImageClassName?: string; contentClassName?: string; tagClassName?: string; titleClassName?: string; descriptionClassName?: string; buttonContainerClassName?: string; buttonClassName?: string; buttonTextClassName?: string; } interface AboutContentProps { title: string; description: string; tag: string; tagIcon?: LucideIcon; buttons?: ButtonConfig[]; useInvertedBackground: "noInvert" | "invertDefault" | "invertCard"; contentClassName: string; tagClassName: string; titleClassName: string; descriptionClassName: string; buttonContainerClassName: string; buttonClassName: string; buttonTextClassName: string; } const AboutContent = ({ title, description, tag, tagIcon: TagIcon, buttons, useInvertedBackground, contentClassName, tagClassName, titleClassName, descriptionClassName, buttonContainerClassName, buttonClassName, buttonTextClassName, }: AboutContentProps) => { const theme = useTheme(); return (
{buttons && buttons.length > 0 && (
{buttons.map((button, index) => (
)}
); }; const AboutPhoneTimeline = ({ title, titleSegments, description, tag, tagIcon, buttons, phoneOne, phoneTwo, textboxLayout, useInvertedBackground, ariaLabel = "About section", className = "", containerClassName = "", desktopContainerClassName = "", mobileContainerClassName = "", desktopContentClassName = "", desktopWrapperClassName = "", mobileWrapperClassName = "", phoneFrameClassName = "", mobilePhoneFrameClassName = "", titleImageWrapperClassName = "", titleImageClassName = "", contentClassName = "", tagClassName = "", titleClassName = "", descriptionClassName = "", buttonContainerClassName = "", buttonClassName = "", buttonTextClassName = "", }: AboutPhoneTimelineProps) => { const timelineItems: TimelinePhoneViewItem[] = useMemo(() => [{ trigger: 'about-trigger', content: ( ), imageOne: phoneOne.imageSrc, videoOne: phoneOne.videoSrc, imageAltOne: phoneOne.imageAlt || `${title} - Image 1`, videoAriaLabelOne: phoneOne.videoAriaLabel || `${title} - Video 1`, imageTwo: phoneTwo.imageSrc, videoTwo: phoneTwo.videoSrc, imageAltTwo: phoneTwo.imageAlt || `${title} - Image 2`, videoAriaLabelTwo: phoneTwo.videoAriaLabel || `${title} - Video 2`, }], [title, description, tag, tagIcon, buttons, phoneOne, phoneTwo, useInvertedBackground, contentClassName, tagClassName, titleClassName, descriptionClassName, buttonContainerClassName, buttonClassName, buttonTextClassName]); return ( ); }; AboutPhoneTimeline.displayName = "AboutPhoneTimeline"; export default memo(AboutPhoneTimeline);