import { Typography } from "@mui/material";
import InfoIcon from "@mui/icons-material/Info";
import { Grid } from "../../../../components/grid/Grid";

export const TradeTimeRangeInfo = ({ range }) => {
  if (!range?.allow) {
    return null;
  }

  return (
    <Grid container xs={12} gap={1} alignItems="center" justifyContent="center">
      <InfoIcon color="primary" />
      <Typography variant="body2" color="error">
        زمان فعالیت پنل معاملات: از ساعت{" "}
        {range?.start_time ? range.start_time.slice(0, 5) : "-"} الی ساعت{" "}
        {range?.end_time ? range.end_time.slice(0, 5) : "-"}
      </Typography>
    </Grid>
  );
};
