frontAnswerer/lib/components/ViewPublicationPage/tools/NextButton.tsx

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-05-01 13:15:54 +00:00
import { useQuizStore } from "@/stores/useQuizStore";
import { Button, Skeleton } from "@mui/material";
2024-03-26 00:06:54 +00:00
import { quizThemes } from "@utils/themes/Publication/themePublication";
2025-04-20 15:16:22 +00:00
import { useTranslation } from "react-i18next";
2024-03-26 00:06:54 +00:00
2024-05-31 16:41:18 +00:00
interface Props {
isNextButtonEnabled: boolean;
moveToNextQuestion: () => void;
2024-03-26 00:06:54 +00:00
}
2024-05-31 16:41:18 +00:00
export default function NextButton({ isNextButtonEnabled, moveToNextQuestion }: Props) {
const { settings, nextLoading } = useQuizStore();
2025-04-20 15:16:22 +00:00
const { t } = useTranslation();
return nextLoading ? (
<Skeleton
variant="rectangular"
sx={{
borderRadius: "8px",
width: "96px",
height: "44px",
}}
/>
) : (
2024-05-31 16:41:18 +00:00
<Button
disabled={!isNextButtonEnabled}
variant="contained"
sx={{
fontSize: "16px",
padding: "10px 15px",
"&:disabled": {
background: quizThemes[settings.cfg.theme].isLight ? "#F2F3F7" : "#FFFFFF26",
},
}}
onClick={moveToNextQuestion}
>
{t("Next")}
2024-05-31 16:41:18 +00:00
</Button>
);
}