"use client"; import CardList from "@/components/cardStack/CardList"; import Tag from "@/components/shared/Tag"; import MediaContent from "@/components/shared/MediaContent"; import Button from "@/components/button/Button"; import { cls, shouldUseInvertedText } from "@/lib/utils"; import { getButtonProps } from "@/lib/buttonUtils"; import { useTheme } from "@/providers/themeProvider/ThemeProvider"; import type { LucideIcon } from "lucide-react"; import type { ButtonConfig, CardAnimationType, TitleSegment } from "@/components/cardStack/types"; import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; type MediaProps = | { imageSrc: string; imageAlt?: string; videoSrc?: never; videoAriaLabel?: never; } | { videoSrc: string; videoAriaLabel?: string; imageSrc?: never; imageAlt?: never; }; type BlogCard = MediaProps & { id: string; category: string; title: string; tags: string[]; buttons?: ButtonConfig[]; onBlogClick?: () => void; }; interface BlogCardNineProps { blogs: BlogCard[]; animationType: CardAnimationType; title: string; titleSegments?: TitleSegment[]; description: string; tag?: string; tagIcon?: LucideIcon; buttons?: ButtonConfig[]; textboxLayout: TextboxLayout; useInvertedBackground: InvertedBackground; ariaLabel?: string; className?: string; containerClassName?: string; cardClassName?: string; textBoxTitleClassName?: string; textBoxDescriptionClassName?: string; textBoxClassName?: string; textBoxTagClassName?: string; textBoxButtonContainerClassName?: string; textBoxButtonClassName?: string; textBoxButtonTextClassName?: string; titleImageWrapperClassName?: string; titleImageClassName?: string; cardContentClassName?: string; mediaWrapperClassName?: string; mediaClassName?: string; categoryClassName?: string; cardTitleClassName?: string; tagsContainerClassName?: string; tagClassName?: string; cardButtonClassName?: string; cardButtonTextClassName?: string; } const BlogCardNine = ({ blogs, animationType, title, titleSegments, description, tag, tagIcon, buttons, textboxLayout, useInvertedBackground, ariaLabel = "Blog section", className = "", containerClassName = "", cardClassName = "", textBoxTitleClassName = "", textBoxDescriptionClassName = "", textBoxClassName = "", textBoxTagClassName = "", textBoxButtonContainerClassName = "", textBoxButtonClassName = "", textBoxButtonTextClassName = "", titleImageWrapperClassName = "", titleImageClassName = "", cardContentClassName = "", mediaWrapperClassName = "", mediaClassName = "", categoryClassName = "", cardTitleClassName = "", tagsContainerClassName = "", tagClassName = "", cardButtonClassName = "", cardButtonTextClassName = "", }: BlogCardNineProps) => { const theme = useTheme(); const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); const getMobileButtonProps = () => { if (theme.defaultButtonVariant === "hover-bubble") { return { bgClassName: "w-full" }; } if (theme.defaultButtonVariant === "icon-arrow") { return { className: "justify-between" }; } return {}; }; return ( {blogs.map((blog) => (
{blog.category}

{blog.title}

{blog.tags.map((tagText, index) => ( ))}
{blog.buttons && blog.buttons.length > 0 && ( <>
{blog.buttons.slice(0, 2).map((button, index) => (
{blog.buttons.slice(0, 2).map((button, index) => (
)}
))}
); }; BlogCardNine.displayName = "BlogCardNine"; export default BlogCardNine;