import clsx from 'clsx'; import Image from '@/components/shared/Image'; import { GlowBg } from '@/components/shared/ui/glow-bg'; /** * A component meant to be used in the landing page. * It displays a title, description and optionally, an image of a product's feature. * * The image could either be left, right or center (larger). * The image can either be shown in perspective or flat. * The section can have a background or not. */ export const LandingProductFeature = ({ children, className, innerClassName, textClassName, title, titleComponent, description, descriptionComponent, leadingComponent, textPosition = 'left', imageSrc, imageAlt = '', imagePosition = 'right', imagePerspective = 'paper', imageShadow = 'hard', imageClassName, zoomOnHover = true, minHeight = 350, withBackground = false, withBackgroundGlow = false, variant = 'primary', backgroundGlowVariant = 'primary', effectComponent, effectClassName, }: { children?: React.ReactNode; className?: string; innerClassName?: string; textClassName?: string; title?: string | React.ReactNode; titleComponent?: React.ReactNode; description?: string | React.ReactNode; descriptionComponent?: React.ReactNode; leadingComponent?: React.ReactNode; textPosition?: 'center' | 'left'; imageSrc?: string; imageAlt?: string; imagePosition?: 'left' | 'right' | 'center'; imagePerspective?: | 'none' | 'left' | 'right' | 'bottom' | 'bottom-lg' | 'paper'; imageShadow?: 'none' | 'soft' | 'hard'; imageClassName?: string; zoomOnHover?: boolean; minHeight?: number; withBackground?: boolean; withBackgroundGlow?: boolean; variant?: 'primary' | 'secondary'; backgroundGlowVariant?: 'primary' | 'secondary'; effectComponent?: React.ReactNode; effectClassName?: string; }) => { return (
{effectComponent ? (
{effectComponent}
) : null} {imageSrc && withBackgroundGlow ? (
) : null}
{leadingComponent} {title ? (

{title}

) : ( titleComponent )} {description ? (

{description}

) : ( descriptionComponent )} {children}
{imageSrc ? ( <> {imagePosition === 'center' ? (
{imageAlt}
) : null} {imagePosition === 'left' || imagePosition === 'right' ? ( {imageAlt} ) : null} ) : null}
); };