Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 73b5c87

Browse files
committed
fix titles not showing with code switcher tabs
1 parent 89cfb75 commit 73b5c87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/code/CodeSwitcher.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { highlight } from './highlight'
77
import { TabItem, Tabs } from '../tabs/Tabs'
88
import { LANGUAGE_LABEL_MAP, languages } from '@/lib/constants'
99
import { CodeTabs } from './CodeTabs'
10+
import { meta } from './meta'
1011

1112
export async function CodeSwitcher({
1213
code,
@@ -36,7 +37,7 @@ export async function CodeSwitcher({
3637
const children = highlighted.map((h) => (
3738
<TabItem key={h.lang} label={LANGUAGE_LABEL_MAP[h.lang]}>
3839
<CodeContainer>
39-
<Pre highlighted={h} {...props} />
40+
<Pre highlighted={h} {...props} showPanel={!!meta(h).title} />
4041
</CodeContainer>
4142
</TabItem>
4243
))

0 commit comments

Comments
 (0)