import MainCard from "../../components/MainCard";
import {Grid, Stack} from "@mui/material";
import CardSummaryContent from "./CardSummaryContent";

const RankingCard = ({
                         cardType,
                         title,
                         customBorderColor,
                         titleClass,
                         selectedYear,
                         boardData,
                         viewDivisionOnly,
                     }) => {

    function getCardContent(cardType) {
        switch (cardType) {
            case 1:
                return (
                    <CardSummaryContent
                        selectedYear={selectedYear}
                        boardData={boardData}
                        viewDivisionOnly={viewDivisionOnly}
                    />
                );
            /*case 2:
                return (
                        <CardHorizontalBarchartContent
                            reverse={reverse}
                            selectedYear={selectedYear}
                            chartData={chartData}
                            boardData={boardData}
                            mean={mean}
                            median={median}
                            useWhiteBoarder={useWhiteBoarder}
                            customCategoryType={customCategoryType}
                        />
                );
            case 3:
                return(
                    <RankingPieChart
                        reverse={reverse}
                        selectedYear={selectedYear}
                        chartData={chartData}
                        boardData={boardData}
                        mean={mean}
                        median={median}
                        useWhiteBoarder={useWhiteBoarder}
                        chartColorAlt={chartColorAlt}
                        customCategoryType={customCategoryType}
                    />
                );
            default:
                return (
                    <CardBarchartContent
                        reverse={reverse}
                        selectedYear={selectedYear}
                        chartData={chartData}
                        boardData={boardData}
                        mean={mean}
                        median={median}
                        useWhiteBoarder={useWhiteBoarder}
                        customCategoryType={customCategoryType}
                    />
                );*/
        }
    }

    return (

        <Grid item xs={12} md={12} lg={12} alignItems="stretch" sx={{height: "100%", width:"100%", display: cardType===1? "flex" : ""}}>
            <MainCard sx={{ml: {lg:1}, mr: {lg:1}, backgroundColor: '#fbfff0'}} style={{border: `4px solid ${customBorderColor} `}}
                      title={title}
                      titleClass={titleClass}
                      boxShadow={3}
            >
                {
                    cardType === 3?
                    <Stack spacing={1.5} sx={{mb: -12}}/>: undefined
                }
                {getCardContent(cardType)}
            </MainCard>
        </Grid>
    );
}

export default RankingCard;
