@barebones/card@0.1.1
latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
29%
Published
7 months ago (0.1.1)
import { type IImageProps, image } from "jsr:@barebones/image@^0.1.1"; import { type ITextProps, text } from "jsr:@barebones/text@^0.1.1"; import { type IBoxProps, box } from "jsr:@barebones/box@^0.1.2"; export interface ICardProps { cardContainer?: string, cardHeader: ITextProps, cardMedia: IImageProps, cardContent: ITextProps, cardFooter?: ITextProps } export const card = ({cardContainer, cardHeader, cardMedia, cardContent, cardFooter}: ICardProps): string => { const header = text({...cardHeader}); const media = image({...cardMedia}); const content = text({...cardContent}); const footer = cardFooter? text({...cardFooter}):'' return ( box({ slot: `\ ${media}\ ${header}\ ${content}\ ${footer}`, rest: cardContainer??'' }) ); }