"use client"; import { memo } from "react"; import TextBox from "@/components/Textbox"; import Tag from "@/components/shared/Tag"; import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; import { cls, shouldUseInvertedText } from "@/lib/utils"; import { useTheme } from "@/providers/themeProvider/ThemeProvider"; import type { LucideIcon } from "lucide-react"; import type { InvertedBackground } from "@/providers/themeProvider/config/constants"; import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; interface ProcessStep { number: string; title: string; description: string; tag?: string; } interface FeatureProcessStepsProps { title: string; description: string; tag?: string; tagIcon?: LucideIcon; tagAnimation?: ButtonAnimationType; buttons?: ButtonConfig[]; buttonAnimation?: ButtonAnimationType; stepsAnimation: ButtonAnimationType; steps: ProcessStep[]; useInvertedBackground: InvertedBackground; ariaLabel?: string; className?: string; containerClassName?: string; gridClassName?: string; leftColumnClassName?: string; rightColumnClassName?: string; textBoxClassName?: string; titleClassName?: string; descriptionClassName?: string; tagClassName?: string; buttonContainerClassName?: string; buttonClassName?: string; buttonTextClassName?: string; stepsContainerClassName?: string; stepClassName?: string; stepNumberClassName?: string; stepContentClassName?: string; stepTitleClassName?: string; stepTagClassName?: string; stepDescriptionClassName?: string; } const FeatureProcessSteps = ({ title, description, tag, tagIcon, tagAnimation, buttons, buttonAnimation, stepsAnimation, steps, useInvertedBackground, ariaLabel = "Process steps section", className = "", containerClassName = "", gridClassName = "", leftColumnClassName = "", rightColumnClassName = "", textBoxClassName = "", titleClassName = "", descriptionClassName = "", tagClassName = "", buttonContainerClassName = "", buttonClassName = "", buttonTextClassName = "", stepsContainerClassName = "", stepClassName = "", stepNumberClassName = "", stepContentClassName = "", stepTitleClassName = "", stepTagClassName = "", stepDescriptionClassName = "", }: FeatureProcessStepsProps) => { const theme = useTheme(); const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); const { containerRef: stepsContainerRef } = useButtonAnimation({ animationType: stepsAnimation }); return (
{steps && steps.length > 0 && (
{steps.map((step, index) => (
{/* Number box with line below */}

{step.number}

{/* Line segment */} {index < steps.length - 1 && (
)}

{step.title}

{step.tag && ( )}

{step.description}

))}
)}
); }; FeatureProcessSteps.displayName = "FeatureProcessSteps"; export default memo(FeatureProcessSteps);