diff --git a/src/entities/runtime-entities.ts b/src/entities/runtime-entities.ts index 510814e..28526d8 100644 --- a/src/entities/runtime-entities.ts +++ b/src/entities/runtime-entities.ts @@ -1,3 +1,11 @@ +export interface RuntimeState { + readonly step: "idle" | "running" | "success" | "unsuccess" | "error"; + readonly text: string; + readonly status: number; + readonly startedAt: number; + readonly finishedAt: number; +} + export interface RequestInfo { readonly url: string; readonly method: string; diff --git a/src/features/project-workspace/ProjectWorkspacePage.tsx b/src/features/project-workspace/ProjectWorkspacePage.tsx index 1d2e43c..90436fe 100644 --- a/src/features/project-workspace/ProjectWorkspacePage.tsx +++ b/src/features/project-workspace/ProjectWorkspacePage.tsx @@ -33,6 +33,7 @@ import { SelectValue, } from "@/components/ui/select"; import { Progress } from "@/components/ui/progress"; +import { RuntimeState } from "@/entities/runtime-entities"; export function ProjectWorkspacePage() { const params = useParams(); @@ -187,13 +188,7 @@ function RequestSpecEditor(props: { ); const patchUrl = patchUrlRef.current; - const [runtime, setRuntime] = useState<{ - step: "idle" | "running" | "success" | "unsuccess" | "error"; - text: string; - status: number; - startedAt: number; - finishedAt: number; - }>({ + const [runtime, setRuntime] = useState({ step: "idle", text: "", status: 0,