forked from algolia/docsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSourceIcon.tsx
More file actions
55 lines (51 loc) · 1.25 KB
/
SourceIcon.tsx
File metadata and controls
55 lines (51 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React, { type JSX } from 'react';
const LvlIcon: React.FC = () => {
return (
<svg width="20" height="20" viewBox="0 0 20 20">
<path
d="M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4"
stroke="currentColor"
fill="none"
fillRule="evenodd"
strokeLinejoin="round"
/>
</svg>
);
};
export function SourceIcon(props: { type: string }): JSX.Element {
switch (props.type) {
case 'lvl1':
return <LvlIcon />;
case 'content':
return <ContentIcon />;
default:
return <AnchorIcon />;
}
}
function AnchorIcon(): JSX.Element {
return (
<svg width="20" height="20" viewBox="0 0 20 20">
<path
d="M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z"
stroke="currentColor"
fill="none"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
function ContentIcon(): JSX.Element {
return (
<svg width="20" height="20" viewBox="0 0 20 20">
<path
d="M17 5H3h14zm0 5H3h14zm0 5H3h14z"
stroke="currentColor"
fill="none"
fillRule="evenodd"
strokeLinejoin="round"
/>
</svg>
);
}