File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
packages/storefront-ui/src/components/SfThumbnail Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ import { Slot , component$ } from '@builder.io/qwik' ;
2+ import { SfThumbnailSize } from '../../shared/SfThumbnail' ;
3+ import { SfThumbnailProps } from './types' ;
4+
5+ const sizeClasses = {
6+ [ SfThumbnailSize . sm ] : 'w-5 h-5' ,
7+ [ SfThumbnailSize . base ] : 'w-6 h-6' ,
8+ [ SfThumbnailSize . lg ] : 'w-10 h-10' ,
9+ [ SfThumbnailSize . xl ] : 'w-14 h-14' ,
10+ } ;
11+ export const SfThumbnail = component$ < SfThumbnailProps > (
12+ ( { size = SfThumbnailSize . base , class : _class , ...attributes } ) => {
13+ return (
14+ < div
15+ class = { [
16+ 'rounded-full overflow-hidden bg-clip-content p-0.5' ,
17+ sizeClasses [ size ] ,
18+ _class ,
19+ ] }
20+ data-testid = "thumbnail"
21+ { ...attributes }
22+ >
23+ < Slot />
24+ </ div >
25+ ) ;
26+ }
27+ ) ;
Original file line number Diff line number Diff line change 1+ export * from './types' ;
2+
3+ export { SfThumbnail } from './SfThumbnail' ;
Original file line number Diff line number Diff line change 1+ import { SfThumbnailSize } from '../../shared/SfThumbnail' ;
2+
3+ export type SfThumbnailProps = {
4+ class : string ;
5+ size ?: `${SfThumbnailSize } `;
6+ } ;
You can’t perform that action at this time.
0 commit comments