This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / webapp / features / profile / components / profileTabs / ProfileTabs.tsx
1.1 kB 38 lines
1'use client'; 2 3import { Group, Paper, ScrollAreaAutosize, Tabs } from '@mantine/core'; 4import TabItem from './TabItem'; 5import { usePathname } from 'next/navigation'; 6 7interface Props { 8 handle: string; 9} 10 11export default function ProfileTabs({ handle }: Props) { 12 const pathname = usePathname(); 13 const segment = pathname.split('/')[3]; 14 const currentTab = segment || 'profile'; // treat base route as 'profile' 15 const basePath = `/profile/${handle}`; 16 17 return ( 18 <Tabs value={currentTab}> 19 <Paper radius={0}> 20 <ScrollAreaAutosize type="scroll"> 21 <Tabs.List> 22 <Group wrap="nowrap"> 23 <TabItem value="profile" href={basePath}> 24 Profile 25 </TabItem> 26 <TabItem value="cards" href={`${basePath}/cards`}> 27 Cards 28 </TabItem> 29 <TabItem value="collections" href={`${basePath}/collections`}> 30 Collections 31 </TabItem> 32 </Group> 33 </Tabs.List> 34 </ScrollAreaAutosize> 35 </Paper> 36 </Tabs> 37 ); 38}