@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 1.72 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["ScrollShadow","SearchResultCard"],"sources":["../../../../src/Markdown/components/SearchResultCards/index.tsx"],"sourcesContent":["'use client';\n\nimport { Ref, memo } from 'react';\n\nimport { FlexboxProps } from '@/Flex';\nimport ScrollShadow from '@/ScrollShadow';\n\nimport SearchResultCard from './SearchResultCard';\n\nexport interface SearchResultItem {\n alt?: string;\n summary?: string;\n title?: string;\n url: string;\n}\n\nexport interface SearchResultCardsProps extends FlexboxProps {\n dataSource: string[] | SearchResultItem[];\n ref?: Ref<HTMLDivElement>;\n}\n\nconst SearchResultCards = memo<SearchResultCardsProps>(({ ref, dataSource, style, ...rest }) => {\n return (\n <ScrollShadow\n gap={12}\n hideScrollBar\n horizontal\n orientation={'horizontal'}\n ref={ref}\n size={10}\n style={{ minHeight: 80, overflowX: 'scroll', paddingInlineEnd: 24, width: '100%', ...style }}\n {...rest}\n >\n {dataSource.map((link) =>\n typeof link === 'string' ? (\n <SearchResultCard key={link} url={link} />\n ) : (\n <SearchResultCard key={link.url} {...link} />\n ),\n )}\n </ScrollShadow>\n );\n});\n\nSearchResultCards.displayName = 'SearchResultCards';\n\nexport default SearchResultCards;\n"],"mappings":";;;;;;;;AAqBA,MAAM,oBAAoB,MAA8B,EAAE,KAAK,YAAY,OAAO,GAAG,WAAW;AAC9F,QACE,oBAACA;EACC,KAAK;EACL;EACA;EACA,aAAa;EACR;EACL,MAAM;EACN,OAAO;GAAE,WAAW;GAAI,WAAW;GAAU,kBAAkB;GAAI,OAAO;GAAQ,GAAG;GAAO;EAC5F,GAAI;YAEH,WAAW,KAAK,SACf,OAAO,SAAS,WACd,oBAACC,4BAA4B,KAAK,QAAX,KAAmB,GAE1C,oBAACA,4BAAgC,GAAI,QAAd,KAAK,IAAiB,CAEhD;GACY;EAEjB;AAEF,kBAAkB,cAAc;AAEhC,gCAAe"}