UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines • 2.26 kB
{"version":3,"file":"FeatureGrid.mjs","names":[],"sources":["../../../src/awesome/FeatureGrid/FeatureGrid.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { type CSSProperties, Fragment, memo } from 'react';\n\nimport { renderLandingLink } from '@/awesome/landingLink';\nimport Icon from '@/Icon';\n\nimport { styles } from './style';\nimport type { FeatureGridProps } from './type';\n\nconst FeatureGrid = memo<FeatureGridProps>(\n ({ className, columns = 3, items, renderLink, style, ...rest }) => (\n <div\n className={cx(styles.grid, className)}\n style={{ '--feature-grid-columns': columns, ...style } as CSSProperties}\n {...rest}\n >\n {items.map(({ description, href, icon, title }, index) => {\n const content = (\n <>\n {icon && (\n <span className={styles.icon}>\n <Icon icon={icon} size={16} />\n </span>\n )}\n <h3 className={styles.title}>{title}</h3>\n <p className={styles.description}>{description}</p>\n </>\n );\n\n return (\n <Fragment key={typeof title === 'string' ? title : index}>\n {href ? (\n renderLandingLink(renderLink, { children: content, className: styles.item, href })\n ) : (\n <div className={styles.item}>{content}</div>\n )}\n </Fragment>\n );\n })}\n </div>\n ),\n);\n\nFeatureGrid.displayName = 'FeatureGrid';\n\nexport default FeatureGrid;\n"],"mappings":";;;;;;;;AAWA,MAAM,cAAc,MACjB,EAAE,WAAW,UAAU,GAAG,OAAO,YAAY,OAAO,GAAG,WACtD,oBAAC,OAAD;CACE,WAAW,GAAG,OAAO,MAAM,SAAS;CACpC,OAAO;EAAE,0BAA0B;EAAS,GAAG;CAAM;CACrD,GAAI;CAEH,UAAA,MAAM,KAAK,EAAE,aAAa,MAAM,MAAM,SAAS,UAAU;EACxD,MAAM,UACJ,qBAAA,YAAA,EAAA,UAAA;GACG,QACC,oBAAC,QAAD;IAAM,WAAW,OAAO;IACtB,UAAA,oBAAC,MAAD;KAAY;KAAM,MAAM;IAAK,CAAA;GACzB,CAAA;GAER,oBAAC,MAAD;IAAI,WAAW,OAAO;IAAQ,UAAA;GAAU,CAAA;GACxC,oBAAC,KAAD;IAAG,WAAW,OAAO;IAAc,UAAA;GAAe,CAAA;EAClD,EAAA,CAAA;EAGJ,OACE,oBAAC,UAAD,EAAA,UACG,OACC,kBAAkB,YAAY;GAAE,UAAU;GAAS,WAAW,OAAO;GAAM;EAAK,CAAC,IAEjF,oBAAC,OAAD;GAAK,WAAW,OAAO;GAAO,UAAA;EAAa,CAAA,EAErC,GANK,OAAO,UAAU,WAAW,QAAQ,KAMzC;CAEd,CAAC;AACE,CAAA,CAET;AAEA,YAAY,cAAc"}