diff --git a/src/components/sections/hero/HeroBillboardGallery.tsx b/src/components/sections/hero/HeroBillboardGallery.tsx index 83075b7..bd2d01d 100644 --- a/src/components/sections/hero/HeroBillboardGallery.tsx +++ b/src/components/sections/hero/HeroBillboardGallery.tsx @@ -1,200 +1,48 @@ -"use client"; +'use client'; -import TextBox from "@/components/Textbox"; -import MediaContent from "@/components/shared/MediaContent"; -import AutoCarousel from "@/components/cardStack/layouts/carousels/AutoCarousel"; -import HeroBackgrounds, { type HeroBackgroundVariantProps } from "@/components/background/HeroBackgrounds"; -import { cls } from "@/lib/utils"; -import { useButtonAnimation } from "@/components/hooks/useButtonAnimation"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, ButtonAnimationType } from "@/types/button"; +import React from 'react'; +import { cn } from '@/lib/utils'; -export interface MediaItem { - imageSrc?: string; - videoSrc?: string; - imageAlt?: string; - videoAriaLabel?: string; -} - -type HeroBillboardGalleryBackgroundProps = Extract< - HeroBackgroundVariantProps, - | { variant: "plain" } - | { variant: "animated-grid" } - | { variant: "canvas-reveal" } - | { variant: "cell-wave" } - | { variant: "downward-rays-animated" } - | { variant: "downward-rays-animated-grid" } - | { variant: "downward-rays-static" } - | { variant: "downward-rays-static-grid" } - | { variant: "gradient-bars" } - | { variant: "radial-gradient" } - | { variant: "rotated-rays-animated" } - | { variant: "rotated-rays-animated-grid" } - | { variant: "rotated-rays-static" } - | { variant: "rotated-rays-static-grid" } - | { variant: "sparkles-gradient" } ->; +export type CardAnimationType = 'none' | 'opacity' | 'slide-up' | 'scale-rotate' | 'blur-reveal'; interface HeroBillboardGalleryProps { - title: string; - description: string; - background: HeroBillboardGalleryBackgroundProps; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - mediaItems: MediaItem[]; - mediaAnimation: ButtonAnimationType; - ariaLabel?: string; + children: React.ReactNode[]; + animationType: CardAnimationType; + itemCount: number; + isGrid?: boolean; className?: string; + carouselClassName?: string; containerClassName?: string; - textBoxClassName?: string; - titleClassName?: string; - descriptionClassName?: string; - tagClassName?: string; - buttonContainerClassName?: string; - buttonClassName?: string; - buttonTextClassName?: string; - mediaWrapperClassName?: string; - imageClassName?: string; + itemClassName?: string; + showTextBox?: boolean; + textboxLayout?: string; + ariaLabel?: string; } -const HeroBillboardGallery = ({ - title, - description, - background, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - mediaItems, - mediaAnimation, - ariaLabel = "Hero section", - className = "", - containerClassName = "", - textBoxClassName = "", - titleClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", - mediaWrapperClassName = "", - imageClassName = "", -}: HeroBillboardGalleryProps) => { - const { containerRef: mediaContainerRef } = useButtonAnimation({ animationType: mediaAnimation }); - - const renderCarouselItem = (item: MediaItem, index: number) => ( -
- -
- ); - - const itemCount = mediaItems?.length || 0; - const desktopWidthClass = itemCount === 3 ? "md:w-[24%]" : itemCount === 4 ? "md:w-[24%]" : "md:w-[23%]"; - +export const HeroBillboardGallery: React.FC = ({ + children, + animationType, + itemCount, + isGrid = false, + className, + carouselClassName, + containerClassName, + itemClassName, + showTextBox = true, + textboxLayout = 'default', + ariaLabel = 'Gallery', +}) => { return ( -
- -
- - -
-
- - {mediaItems?.slice(0, 5).map(renderCarouselItem)} - +
+
+ {React.Children.map(children, (child, index) => ( +
+ {child}
- -
-
- {mediaItems?.slice(0, 5).map((item, index) => { - const rotations = ["-rotate-6", "rotate-6", "-rotate-6", "rotate-6", "-rotate-6"]; - const zIndexes = ["z-10", "z-20", "z-30", "z-40", "z-50"]; - const translates = ["-translate-y-5", "translate-y-5", "-translate-y-5", "translate-y-5", "-translate-y-5"]; - const marginClass = index > 0 ? "-ml-12 md:-ml-15" : ""; - - return ( -
- -
- ); - })} -
-
-
+ ))}
-
+ ); }; -HeroBillboardGallery.displayName = "HeroBillboardGallery"; - export default HeroBillboardGallery;