import type { ReactNode } from 'react' import { cn } from '../../lib/cn' import { Text } from '../Text' import { Marquee } from '../Marquee' export interface LogoItem { /** Company name. This is what a screen reader hears. */ name: string /** Inline SVG or image. Drawn in currentColor, so it takes the muted tone. */ logo: ReactNode } export interface LogoCloudProps { logos: LogoItem[] /** The claim the logos support — "Trusted by 4,000 teams". */ title?: ReactNode /** row wraps centred; grid draws hairline cells; marquee scrolls. */ variant?: 'row' | 'grid' | 'marquee' className?: string } /** * Social proof as a strip of customer marks. * * Every mark is flattened to the faint ink tone. A row of logos in their own * brand colours is a row of competing calls to action; in one tone they read as * a single fact — "people like you use this" — which is all the strip is for. * * Each logo is exposed as an image named for the company, since the marks are * frequently the only place the names appear. */ export function LogoCloud({ logos, title, variant = 'row', className }: LogoCloudProps) { const mark = (item: LogoItem) => ( {item.logo} ) return (
{title && ( {title} )} {variant === 'marquee' ? ( {logos.map((item) => ( {mark(item)} ))} ) : variant === 'grid' ? ( ) : ( )}
) }