import {useTranslations} from "next-intl";
import {Typography} from "@mui/material";

const ErrorOrEmpty = ({isErrorOrEmpty}) => {
    const t = useTranslations();
    return (
        <>
            {isErrorOrEmpty === "error" ?
                <Typography variant="subtitle1" sx={{
                    color: "#837e7e",
                    fontWeight: "500",
                    letterSpacing: 1,
                    textAlign: "center",
                    mt: "50%"
                }}>
                    {t("CallHistory.call_history_error_fetching")}
                </Typography>
                : isErrorOrEmpty === "empty" ?
                    <Typography variant="subtitle1" sx={{
                        color: "#837e7e",
                        fontWeight: "500",
                        letterSpacing: 1,
                        textAlign: "center",
                        mt: "50%"
                    }}>
                        {t("CallHistory.call_history_not_found")}
                    </Typography> : <></>
            }
        </>
    )
}

export default ErrorOrEmpty
