-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout de l'onglet indicateurs sur les pages collectivité personnalisées
- Loading branch information
Showing
2 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
packages/site/app/collectivites/[code]/[name]/PageContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use client'; | ||
|
||
import { Tab, Tabs } from '@tet/ui'; | ||
|
||
type PageContentType = { | ||
indicateurs: JSX.Element | null; | ||
programme: JSX.Element | null; | ||
}; | ||
|
||
const PageContent = ({ indicateurs, programme }: PageContentType) => { | ||
if (!indicateurs && !programme) | ||
return <div className="col-span-full md:col-span-7 lg:col-span-8" />; | ||
|
||
if (indicateurs && programme) { | ||
return ( | ||
<Tabs | ||
className="col-span-full md:col-span-7 lg:col-span-8" | ||
tabsListClassName="!bg-primary-1" | ||
> | ||
<Tab label="Indicateurs locaux">{indicateurs}</Tab> | ||
<Tab label="Programme T.E.T.E.">{programme}</Tab> | ||
</Tabs> | ||
); | ||
} else if (indicateurs) return indicateurs; | ||
else if (programme) return programme; | ||
}; | ||
|
||
export default PageContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters