import { Box, Typography, useMediaQuery, useTheme } from "@mui/material"; import { useState } from "react"; import ExpandIcon from "./icons/ExpandIcon"; interface Props { header: string; text: string; } export default function CustomAccordion({ header, text }: Props) { const theme = useTheme(); const upMd = useMediaQuery(theme.breakpoints.up("md")); const upXs = useMediaQuery(theme.breakpoints.up("xs")); const [isExpanded, setIsExpanded] = useState(false); return ( setIsExpanded(prev => !prev)} sx={{ height:upMd ? "72px" : undefined, px: "20px", pt: upMd ? "29px" : "26px", pb: upMd ? "21px" : "20px", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: "pointer", userSelect: "none", rowGap:"10px", flexDirection: upXs ? undefined :"column", }} > {header} {isExpanded && {text} } ); }