Skip to content

Commit

Permalink
wip: runtime state as entity, starting transition to detailed state
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazuh committed Feb 24, 2024
1 parent 4a2645c commit d97d20a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/entities/runtime-entities.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
9 changes: 2 additions & 7 deletions src/features/project-workspace/ProjectWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<RuntimeState>({
step: "idle",
text: "",
status: 0,
Expand Down

0 comments on commit d97d20a

Please sign in to comment.