chore: remove docs/components/tabs.client

This commit is contained in:
javayhu 2025-04-12 13:26:05 +08:00
parent 10c7646fb1
commit 1f4bec8eb2
3 changed files with 2 additions and 48 deletions

View File

@ -1,45 +0,0 @@
'use client';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { useEffect, useState } from 'react';
export function UrlBar() {
const [url, setUrl] = useState('');
useEffect(() => {
const timer = setInterval(() => {
setUrl(window.location.pathname + window.location.hash);
}, 100);
return () => {
clearInterval(timer);
};
}, []);
return <pre className="rounded-lg border bg-card p-2 text-sm">{url}</pre>;
}
export function WithoutValueTest() {
const [items, setItems] = useState(['Item 1', 'Item 2']);
return (
<>
<Tabs items={items}>
{items.map((item) => (
<Tab key={item}>{item}</Tab>
))}
</Tabs>
<button
className={cn(
buttonVariants({
variant: 'secondary',
}),
)}
onClick={() => setItems(['Item 1', 'Item 3', 'Item 2'])}
>
Change Items
</button>
</>
);
}

View File

@ -39,7 +39,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tab>Rust is fast</Tab>
</Tabs>
<WithoutValueTest />
{/* <WithoutValueTest /> */}
### Shared Value
@ -119,7 +119,7 @@ to automatically update the URL hash whenever time a new tab is selected:
</Tabs>
```
<UrlBar />
{/* <UrlBar /> */}
<Tabs items={['Hello', 'World']} updateAnchor>
<Tab id="tab-hello" value="Hello">

View File

@ -127,7 +127,6 @@ export default async function DocPage({
</HoverCard>
);
},
...(await import('@/content/docs/components/tabs.client')),
}}
includeFumadocsComponents={true}
/>