Skip to content
File

Blob: worker/src/client/ui/icons.tsx

typescript79 lines
1import type { SVGProps } from 'react';
2 
3export function Icon({
4 name,
5 ...props
6}: SVGProps<SVGSVGElement> & {
7 name:
8 | 'play'
9 | 'pause'
10 | 'sound'
11 | 'muted'
12 | 'restart'
13 | 'arrow'
14 | 'chip'
15 | 'cloud'
16 | 'wave'
17 | 'control';
18}) {
19 const paths = {
20 play: <path d="m8 5 11 7-11 7Z" />,
21 pause: (
22 <>
23 <path d="M8 5v14M16 5v14" />
24 </>
25 ),
26 sound: (
27 <>
28 <path d="m11 5-5 4H3v6h3l5 4Z" />
29 <path d="M15 8a6 6 0 0 1 0 8m3-11a10 10 0 0 1 0 14" />
30 </>
31 ),
32 muted: (
33 <>
34 <path d="m11 5-5 4H3v6h3l5 4Z" />
35 <path d="m16 9 5 6m0-6-5 6" />
36 </>
37 ),
38 restart: (
39 <>
40 <path d="M3 11a9 9 0 1 1 2 7M3 4v7h7" />
41 </>
42 ),
43 arrow: (
44 <>
45 <path d="M4 12h16m-6-6 6 6-6 6" />
46 </>
47 ),
48 chip: (
49 <>
50 <rect x="6" y="6" width="12" height="12" rx="2" />
51 <path d="M9 2v4m6-4v4M9 18v4m6-4v4M2 9h4m-4 6h4m12-6h4m-4 6h4" />
52 </>
53 ),
54 cloud: <path d="M6 18a4 4 0 1 1 .7-7.94A6 6 0 0 1 18.4 9a4.5 4.5 0 1 1 .1 9Z" />,
55 wave: <path d="M2 12h3l3-8 4 16 4-12 3 4h3" />,
56 control: (
57 <>
58 <path d="M4 7h16M4 17h16" />
59 <circle cx="9" cy="7" r="3" />
60 <circle cx="16" cy="17" r="3" />
61 </>
62 ),
63 };
64 return (
65 <svg
66 viewBox="0 0 24 24"
67 fill="none"
68 stroke="currentColor"
69 strokeWidth="1.6"
70 strokeLinecap="round"
71 strokeLinejoin="round"
72 aria-hidden="true"
73 {...props}
74 >
75 {paths[name]}
76 </svg>
77 );
78}