|
| 1 | +import { useState } from 'react' |
| 2 | +import Link from 'next/link' |
| 3 | +import Button from '@mui/material/Button' |
| 4 | +import Box from '@mui/material/Box' |
| 5 | +import Container from '@mui/material/Container' |
| 6 | +import Grid from '@mui/material/Grid' |
| 7 | +import Typography from '@mui/material/Typography' |
| 8 | + |
| 9 | +import NavigationTabs from '@/domain/profiletabs/navigationtabs' |
| 10 | +import TabPanel from '@/domain/profiletabs/tabpanel' |
| 11 | + |
| 12 | +// Main tab sections |
| 13 | +import GHGEmmissions from '@/domain/profiletabs/sections/ghgemmissions' |
| 14 | +import ClimateRisks from '@/domain/profiletabs/sections/climaterisks' |
| 15 | +import ClimateChange from '@/domain/profiletabs/sections/climatechange' |
| 16 | +import ArticleText from '@/components/common/layout/articletext' |
| 17 | +import styles from './styles' |
| 18 | + |
| 19 | +function ProfileTabsComponent ({ |
| 20 | + country, |
| 21 | + // countries, |
| 22 | + textData, |
| 23 | + donutData, |
| 24 | + barData, |
| 25 | + // handleSelectCountry |
| 26 | +}) { |
| 27 | + const [tab, setTab] = useState(0) |
| 28 | + |
| 29 | + return ( |
| 30 | + <Grid container> |
| 31 | + {/** Header */} |
| 32 | + <Grid item xs={12} sx={styles.headerContainer}> |
| 33 | + <Container maxWidth='lg' sx={styles.headerContent}> |
| 34 | + <Box sx={styles.headerTitle}> |
| 35 | + <Box> |
| 36 | + <Typography variant='h1'> |
| 37 | + {country} |
| 38 | + </Typography> |
| 39 | + <Typography variant='h4'> |
| 40 | + Country Profile |
| 41 | + </Typography> |
| 42 | + </Box> |
| 43 | + |
| 44 | + <Link href='/countries' passHref> |
| 45 | + <Button variant='outlined'> |
| 46 | + Countries |
| 47 | + </Button> |
| 48 | + </Link> |
| 49 | + </Box> |
| 50 | + |
| 51 | + <NavigationTabs |
| 52 | + onTabSelect={(newValue) => { |
| 53 | + setTab(newValue) |
| 54 | + }} |
| 55 | + /> |
| 56 | + </Container> |
| 57 | + </Grid> |
| 58 | + |
| 59 | + <Grid item xs={12}> |
| 60 | + <Container maxWidth='lg'> |
| 61 | + <TabPanel value={tab} index={0}> |
| 62 | + <GHGEmmissions |
| 63 | + donutData={donutData} |
| 64 | + textData={textData[0]} |
| 65 | + /> |
| 66 | + </TabPanel> |
| 67 | + <TabPanel value={tab} index={1}> |
| 68 | + <ClimateRisks barData={barData} textData={textData[0]} /> |
| 69 | + </TabPanel> |
| 70 | + <TabPanel value={tab} index={2}> |
| 71 | + <ClimateChange barData={barData} textData={textData[0]} /> |
| 72 | + </TabPanel> |
| 73 | + <TabPanel value={tab} index={3}> |
| 74 | + <ArticleText {...textData[1]} /> |
| 75 | + </TabPanel> |
| 76 | + <TabPanel value={tab} index={4}> |
| 77 | + <ArticleText {...textData[2]} /> |
| 78 | + </TabPanel> |
| 79 | + </Container> |
| 80 | + </Grid> |
| 81 | + </Grid> |
| 82 | + ) |
| 83 | +} |
| 84 | + |
| 85 | +export default ProfileTabsComponent |
0 commit comments