import tw from '../../../tw'; import BlockTitle from '../../Internal/BlockTitle'; import { CardProps, CardShort } from '../types'; import useLocalizedText from '../../../useLocalizedText'; import CarouselNavigation from '../CarouselNavigation'; import ActionOrLink from '../../ActionOrLink'; import Truncated from '../Truncated'; import { RichText } from '../../RichText'; interface ShortProps extends CardProps {} const getBgClassName = (bgColor: CardShort['backgroundColor']) => { switch (bgColor) { case 'transparent-black': return tw`bg-transparent text-black border-[1px] border-[rgba(0,0,0,0.2)]`; case 'transparent-white': return tw`bg-transparent text-white border-[1px] border-[rgba(255,255,255,0.2)]`; case 'white': return tw`bg-white text-black`; case 'black': default: return tw`bg-black text-white border-[1px] border-black`; } }; const Short = ({ title, styles, cards, container, canScroll, scroll, className = ',', }: ShortProps) => { const { localize } = useLocalizedText(); return (
{title && }
{(cards as CardShort[]).map( ( { title, subtitle, description, backgroundColor, action }, index ) => (
{subtitle && ( {(truncatedText) => truncatedText} )} {(truncatedText) => truncatedText} {(truncatedText) => ( {truncatedText || ''} )}
) )}
); }; export default Short;