Skip to content

Commit

Permalink
feat: Dont show tech table if no data available
Browse files Browse the repository at this point in the history
  • Loading branch information
mayan-000 committed Dec 26, 2023
1 parent 1c72f0d commit 79b3ca7
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ interface LayoutProps {

const Layout = ({ selectedSite }: LayoutProps) => {
const [data, setData] = useState<SidebarItems>(TABS);
const { tabCookies } = useContentStore(({ state }) => ({
const { tabCookies, technologyData } = useContentStore(({ state }) => ({
tabCookies: state.tabCookies,
technologyData: state.technologies,
}));

const frameUrls = useMemo(
Expand Down Expand Up @@ -113,13 +114,17 @@ const Layout = ({ selectedSite }: LayoutProps) => {
<SiteAffectedCookies selectedSite={selectedSite} />
);

_data['technologies'].panel = (
<Technologies selectedSite={selectedSite} />
);
if (technologyData && technologyData.length > 0) {
_data['technologies'].panel = (
<Technologies selectedSite={selectedSite} />
);
} else {
delete _data['technologies'];
}

return _data;
});
}, [frameUrls, selectedItemKey, selectedSite]);
}, [frameUrls, selectedItemKey, selectedSite, technologyData]);

useEffect(() => {
if (selectedItemKey === null) {
Expand Down

0 comments on commit 79b3ca7

Please sign in to comment.