Spaces:
Paused
Paused
Download frontend/apps/customer/src/components/Skeleton.tsx from TeamError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/TeamError404/nexus/resolve/main/frontend/apps/customer/src/components/Skeleton.tsx
- Command line
-
hf download hf://spaces/TeamError404/nexus/frontend/apps/customer/src/components/Skeleton.tsx
-
curl -L -o Skeleton.tsx https://huggingface.co/spaces/TeamError404/nexus/resolve/main/frontend/apps/customer/src/components/Skeleton.tsx
1.01 kB
| import React from 'react'; | |
| interface SkeletonProps { | |
| width?: string | number; | |
| height?: string | number; | |
| borderRadius?: string | number; | |
| marginBottom?: string | number; | |
| style?: React.CSSProperties; | |
| className?: string; | |
| } | |
| export const Skeleton: React.FC<SkeletonProps> = ({ | |
| width = '100%', | |
| height = '1em', | |
| borderRadius = 4, | |
| marginBottom = 0, | |
| style, | |
| className | |
| }) => { | |
| const skeletonStyle: React.CSSProperties = { | |
| width, | |
| height, | |
| borderRadius, | |
| marginBottom, | |
| background: '#E5E7EB', | |
| backgroundImage: 'linear-gradient(90deg, #E5E7EB 0px, #F3F4F6 50%, #E5E7EB 100%)', | |
| backgroundSize: '200% 100%', | |
| animation: 'skeleton-pulse 1.5s infinite linear', | |
| ...style | |
| }; | |
| return ( | |
| <> | |
| <style> | |
| {` | |
| @keyframes skeleton-pulse { | |
| 0% { background-position: 200% 0; } | |
| 100% { background-position: -200% 0; } | |
| } | |
| `} | |
| </style> | |
| <div style={skeletonStyle} className={className} /> | |
| </> | |
| ); | |
| }; | |