32 lines
855 B
TypeScript
32 lines
855 B
TypeScript
"use client";
|
|
|
|
import { Navigate } from "react-router-dom";
|
|
|
|
import {
|
|
WorkspaceBody,
|
|
WorkspaceContainer,
|
|
} from "@/components/workspace/workspace-container";
|
|
import { useSchedulerThread } from "@/core/scheduled-tasks";
|
|
|
|
export default function ScheduledChatPage() {
|
|
const { data, isLoading, error } = useSchedulerThread();
|
|
|
|
if (data?.thread_id) {
|
|
return <Navigate to={`/page/workspace/chats/${data.thread_id}`} replace />;
|
|
}
|
|
|
|
return (
|
|
<WorkspaceContainer>
|
|
<WorkspaceBody>
|
|
<div className="flex size-full items-center justify-center text-sm text-muted-foreground">
|
|
{isLoading
|
|
? "正在打开定时任务助手..."
|
|
: error
|
|
? "无法打开定时任务助手"
|
|
: "准备定时任务助手..."}
|
|
</div>
|
|
</WorkspaceBody>
|
|
</WorkspaceContainer>
|
|
);
|
|
}
|