53 lines
859 B
TypeScript
Raw Normal View History

export type SvgName =
| 'back'
| 'dislike'
| 'dj'
| 'email'
| 'explicit'
| 'eye-off'
| 'eye'
| 'fm'
| 'forward'
| 'heart-outline'
| 'heart'
| 'home'
| 'lock'
| 'lyrics'
| 'more'
| 'music-library'
| 'music-note'
| 'next'
| 'pause'
| 'phone'
| 'play-fill'
| 'play'
| 'playlist'
| 'podcast'
| 'previous'
| 'qrcode'
| 'repeat'
| 'repeat-1'
| 'search'
| 'settings'
| 'shuffle'
| 'user'
| 'volume-half'
| 'volume-mute'
| 'volume'
| 'windows-close'
| 'windows-minimize'
| 'windows-maximize'
| 'windows-un-maximize'
| 'x'
2022-05-13 23:33:11 +08:00
2022-05-29 17:53:27 +08:00
const Icon = ({ name, className }: { name: SvgName; className?: string }) => {
2022-03-13 14:40:38 +08:00
const symbolId = `#icon-${name}`
return (
2022-03-17 19:30:43 +08:00
<svg aria-hidden='true' className={className}>
<use href={symbolId} fill='currentColor' />
2022-03-13 14:40:38 +08:00
</svg>
)
}
2022-05-29 17:53:27 +08:00
export default Icon