source:
chapterx-frontend/src/components/ui/Spinner.tsx@
a8f4a2d
| Last change on this file since a8f4a2d was b62cefc, checked in by , 4 months ago | |
|---|---|
|
|
| File size: 696 bytes | |
| Rev | Line | |
|---|---|---|
| [b62cefc] | 1 | import React from 'react' |
| 2 | ||
| 3 | interface SpinnerProps { | |
| 4 | size?: 'sm' | 'md' | 'lg' | |
| 5 | className?: string | |
| 6 | } | |
| 7 | ||
| 8 | const sizes = { sm: 'h-4 w-4', md: 'h-8 w-8', lg: 'h-12 w-12' } | |
| 9 | ||
| 10 | export const Spinner: React.FC<SpinnerProps> = ({ size = 'md', className = '' }) => ( | |
| 11 | <svg | |
| 12 | className={`animate-spin ${sizes[size]} text-indigo-400 ${className}`} | |
| 13 | xmlns="http://www.w3.org/2000/svg" | |
| 14 | fill="none" | |
| 15 | viewBox="0 0 24 24" | |
| 16 | > | |
| 17 | <circle | |
| 18 | className="opacity-25" | |
| 19 | cx="12" | |
| 20 | cy="12" | |
| 21 | r="10" | |
| 22 | stroke="currentColor" | |
| 23 | strokeWidth="4" | |
| 24 | /> | |
| 25 | <path | |
| 26 | className="opacity-75" | |
| 27 | fill="currentColor" | |
| 28 | d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" | |
| 29 | /> | |
| 30 | </svg> | |
| 31 | ) |
Note:
See TracBrowser
for help on using the repository browser.
