import { useState } from "react"; import { api } from "../lib/api"; import { useNavigate } from "react-router"; interface Session { id: string; appId: string; userId: string | null; mode: "stream" | "local"; status: "starting" | "started" | "ending" | "ended"; tier: "demo" | "prod"; serverId: string | null; appPid: number | null; cirrusPid: number | null; startAt: string; endAt: string | null; } function TestPage() { const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const navigate = useNavigate(); const handleStartSession = async () => { setIsLoading(true); setError(null); try { const response = await api .post("sessions", { json: { appId: "2914d736-b928-461c-b58f-e5d35d8b605d", mode: "stream", tier: "demo", }, }) .json<{ session: Session }>(); // Перенаправляем на страницу сессии navigate(`/sessions/${response.session.id}`); } catch (err) { console.error("Failed to start session:", err); setError( err instanceof Error ? err.message : "Не удалось запустить приложение" ); } finally { setIsLoading(false); } }; return (

Тестовая страница

Запустите демо-приложение без авторизации

{error && (
{error}
)}
); } export default TestPage;