"use client"; import { useI18n } from "@/translations/provider"; import InformationSheet from "./information-sheet"; import SwipeButton from "./swipe-button"; export type TestCompletedSheetProps = { isOpen: boolean; onClose: () => void; title?: string; closeOnOutside?: boolean; }; export function TestCompletedSheet({ isOpen, onClose, title, closeOnOutside = true, }: TestCompletedSheetProps) { const { dictionary: t, locale } = useI18n(); if (!isOpen) { return null; } const isFa = locale === "fa"; const sheetTitle = title || (t as Record)["Test Completed"] || (isFa ? "آزمون تکمیل شده است" : "Test Completed"); const message = isFa ? "شما این آزمون را قبلاً تکمیل کرده‌اید و امکان شرکت مجدد در آن وجود ندارد." : (t as Record)["You have already completed this test, and it cannot be retaken."] || "You have already completed this test, and it cannot be retaken."; const buttonLabel = (t as Record)["Got it"] || (isFa ? "متوجه شدم" : "Got it"); return ( {message}

} buttons={({ close }) => ( )} closeOnOutside={closeOnOutside} onClose={onClose} /> ); } export default TestCompletedSheet;