File tree Expand file tree Collapse file tree 8 files changed +74
-428
lines changed Expand file tree Collapse file tree 8 files changed +74
-428
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,6 @@ export * from './components/button';
22
33export * from './components/card' ;
44
5+ export * from './components/tabs' ;
6+
57export * from './types' ;
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ import { usePathname } from 'next/navigation' ;
4+ import type { TabsOptionData } from 'soybean-react-ui' ;
5+ import { Tabs } from 'soybean-react-ui' ;
6+
7+ type DemoTabsProps = {
8+ items : TabsOptionData [ ] ;
9+ } ;
10+
11+ export default function DemoTabs ( { items } : DemoTabsProps ) {
12+ const pathname = usePathname ( ) ;
13+
14+ const currentTab = pathname . split ( '/' ) . pop ( ) ;
15+
16+ return (
17+ < Tabs
18+ items = { items }
19+ value = { currentTab }
20+ />
21+ ) ;
22+ }
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+ import { usePathname } from 'next/navigation' ;
3+
4+ const DemoTitle = ( ) => {
5+ const pathname = usePathname ( ) ;
6+
7+ const currentTab = pathname . split ( '/' ) . pop ( ) ;
8+
9+ if ( ! currentTab ) return null ;
10+
11+ const title = currentTab . charAt ( 0 ) . toUpperCase ( ) + currentTab . slice ( 1 ) ;
12+
13+ return title ;
14+ } ;
15+
16+ export default DemoTitle ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments