import React, { FC } from "react"; import { cn } from "../../../lib/cn"; import LaTextContainer from "./LaTextContainer"; import { CopyIcon } from "../../../assets/icons/missions"; // import FullLatexRenderer from "./FullLatexRenderer"; import { useState } from "react"; interface CopyableDivPropd{ content: string; } const CopyableDiv: FC = ({ content }) => { const [hovered, setHovered] = useState(false); const handleCopy = async () => { try { await navigator.clipboard.writeText(content); alert("Скопировано!"); } catch (err) { console.error("Ошибка копирования:", err); } }; return (
setHovered(true)} onMouseLeave={() => setHovered(false)} > {content} copy
); } export interface StatementData { id?: number; name?: string; tags?: string[]; timeLimit?: number; memoryLimit?: number; legend?: string; input?: string; output?: string; sampleTests?: { input: string; output: string }[]; notes?: string; html?: string; mediaFiles?: { id: number; fileName: string; mediaUrl: string }[]; } function extractDivByClass(html: string, className: string): string { const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); const div = doc.querySelector(`div.${className}`); return div ? div.outerHTML : ""; } const Statement: React.FC = ({ id, name, tags, timeLimit = 1000, memoryLimit = 256 * 1024 * 1024, legend = "", input = "", output = "", sampleTests = [], notes = "", html = "", mediaFiles, }) => { return (

{name}

Задача #{id}

{tags && tags.map((v, i) =>
{v}
)}

ограничение по времени на тест: {timeLimit / 1000} секунда

ограничение по памяти на тест: {memoryLimit / 1024 / 1024} мегабайт

ввод: стандартный ввод

вывод: стандартный вывод

{sampleTests.length == 1 ? "Пример" : "Примеры"}
{sampleTests.map((v, i) =>
Входные данные
Выходные данные
)}
Автор: Jacks
); }; export default Statement;