diff --git a/next-tavla/src/Admin/scenarios/TilesOverview/index.tsx b/next-tavla/src/Admin/scenarios/TilesOverview/index.tsx index 3dda3c27b9..9e1b45ca15 100644 --- a/next-tavla/src/Admin/scenarios/TilesOverview/index.tsx +++ b/next-tavla/src/Admin/scenarios/TilesOverview/index.tsx @@ -1,5 +1,5 @@ import { TTile } from 'types/tile' -import React from 'react' +import React, { useEffect, useState } from 'react' import { TileSettings } from 'Admin/scenarios/TileSettings' import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@entur/tab' import Image from 'next/image' @@ -8,6 +8,12 @@ import classes from './styles.module.css' import { Heading2, LeadParagraph } from '@entur/typography' function TilesOverview({ tiles }: { tiles: TTile[] }) { + const [activeTab, setActiveTab] = useState(0) + + useEffect(() => { + setActiveTab(0) + }, [tiles.length]) + if (tiles.length === 0) return (