-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.tsx
More file actions
70 lines (65 loc) · 2.03 KB
/
Copy pathHeader.tsx
File metadata and controls
70 lines (65 loc) · 2.03 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { useAtom } from 'jotai'
import { viewAtom } from '#/lib/atoms'
import { useGraphQuery } from '#/lib/queries'
const TABS = [
{ value: 'network', label: '전체 관계망' },
{ value: 'map', label: '뉴스맵' },
{ value: 'verify', label: '예측 검증' },
] as const
export default function Header() {
const [view, setView] = useAtom(viewAtom)
const { data: graph } = useGraphQuery()
return (
<header
className="sticky top-0 z-40 flex items-center gap-6 border-b px-6"
style={{
height: 'var(--gnb-h)',
borderColor: 'var(--n-150)',
background: 'rgba(255,255,255,.9)',
backdropFilter: 'blur(14px)',
}}
>
<div className="flex items-baseline gap-2">
<b className="text-[19px] font-extrabold tracking-[-0.035em]">
KOS<span style={{ color: 'var(--o-500)' }}>LINK</span>
</b>
<em
className="text-xs font-medium not-italic"
style={{ color: 'var(--n-500)' }}
>
뉴스로 읽는 종목 관계
</em>
</div>
<nav className="flex gap-0.5">
{TABS.map((tab) => {
const active = view === tab.value
return (
<button
key={tab.value}
type="button"
onClick={() => setView(tab.value)}
className="rounded-[9px] px-3.5 py-2 text-[14.5px] font-semibold"
style={{
color: active ? '#fff' : 'var(--n-500)',
background: active ? 'var(--n-900)' : 'transparent',
}}
>
{tab.label}
</button>
)
})}
</nav>
<div
className="ml-auto hidden items-center gap-1.5 text-xs font-medium sm:flex"
style={{ color: 'var(--n-500)' }}
>
<i
className="inline-block h-1.5 w-1.5 rounded-full"
style={{ background: '#0f8a5f' }}
/>
온톨로지 {graph?.nodes.length ?? 0}개 노드 · {graph?.edges.length ?? 0}
개 관계
</div>
</header>
)
}