forked from TanStack/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
41 lines (37 loc) · 1.31 KB
/
index.tsx
File metadata and controls
41 lines (37 loc) · 1.31 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
import { Show, createSignal } from 'solid-js'
import { MainPanel } from '@tanstack/devtools-ui'
import { useStyles } from '../../styles/use-styles'
import { SocialPreviewsSection } from './social-previews'
import { SerpPreviewSection } from './serp-preview'
type SeoSubView = 'social-previews' | 'serp-preview'
export const SeoTab = () => {
const [activeView, setActiveView] =
createSignal<SeoSubView>('social-previews')
const styles = useStyles()
return (
<MainPanel withPadding>
<nav class={styles().seoSubNav} aria-label="SEO sections">
<button
type="button"
class={`${styles().seoSubNavLabel} ${activeView() === 'social-previews' ? styles().seoSubNavLabelActive : ''}`}
onClick={() => setActiveView('social-previews')}
>
Social previews
</button>
<button
type="button"
class={`${styles().seoSubNavLabel} ${activeView() === 'serp-preview' ? styles().seoSubNavLabelActive : ''}`}
onClick={() => setActiveView('serp-preview')}
>
SERP Preview
</button>
</nav>
<Show when={activeView() === 'social-previews'}>
<SocialPreviewsSection />
</Show>
<Show when={activeView() === 'serp-preview'}>
<SerpPreviewSection />
</Show>
</MainPanel>
)
}