forked from 027xiguapi/code-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.tsx
75 lines (71 loc) · 1.36 KB
/
content.tsx
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { useStorage } from "@plasmohq/storage/dist/hook"
import React from "react"
import Csdn from "~component/csdn"
import Zhihu from "~component/zhihu"
import Jianshu from "~component/jianshu"
import Jb51 from "~component/jb51"
import Cnblogs from "~component/cnblogs"
import Cto51 from "~component/51cto"
import Custom from "~component/custom"
const itemMap = {
csdn: <Csdn />,
zhihu: <Zhihu />,
jianshu: <Jianshu />,
jb51: <Jb51 />,
cnblogs: <Cnblogs />,
"51cto": <Cto51 />,
custom: <Custom />,
}
export default function Content() {
const [items] = useStorage("app-items", [
{
id: "1",
value: "csdn",
label: "csdn",
isShow: true,
},
{
id: "2",
value: "zhihu",
label: "知乎",
isShow: true,
},
{
id: "3",
value: "jianshu",
label: "简书",
isShow: true,
},
{
id: "4",
value: "jb51",
label: "脚本之家",
isShow: true,
},
{
id: "5",
value: "cnblogs",
label: "博客园",
isShow: true,
},
{
id: "6",
value: "51cto",
label: "51CTO",
isShow: true,
},
{
id: "7",
value: "custom",
label: "自定义",
isShow: true,
}
])
return (
<>
{items.map((item, index) => (
item.isShow ? itemMap[item.value] : <></>
))}
</>
)
}