Skip to content

Commit 36e4090

Browse files
committed
Registered tab is highlighted now
1 parent 568d838 commit 36e4090

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export default function AIModelsPage({
258258
<Navigation
259259
setNavigationTab={setNavigationTab}
260260
options={navigationOptions}
261+
currentValue={navigationTab ?? 'registered'}
261262
/>
262263

263264
{AllAIModels.data?.aiModels.length > 0 ? (

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/components/navigate-org-datasets.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ import { Tab, TabList, Tabs } from 'opub-ui';
33
export const Navigation = ({
44
setNavigationTab,
55
options,
6+
currentValue,
67
}: {
78
setNavigationTab: (url: string) => void;
89
options: Array<{
910
label: string;
1011
url: string;
1112
selected: boolean;
1213
}>;
14+
currentValue: string;
1315
}) => {
1416
const handleTabClick = (url: string) => {
1517
setNavigationTab(url);
1618
};
17-
19+
const initialValue = options.find((o) => o.selected)?.url ?? options[0]?.url ?? '';
1820
return (
1921
<div>
20-
<Tabs defaultValue="drafts">
22+
<Tabs defaultValue={currentValue ?? initialValue}>
2123
<TabList fitted border>
2224
{options.map((item, index) => (
2325
<Tab

0 commit comments

Comments
 (0)