mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-05 12:40:38 +08:00
Also happens to fix some issues with the no-changes are-you-sure dialog only appearing once and other form values not being reset correctly.
30 lines
874 B
TypeScript
30 lines
874 B
TypeScript
import { Container } from "@chakra-ui/react";
|
|
import Head from "next/head";
|
|
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
|
|
import { Task } from "src/components/Tasks/Task";
|
|
import { useLabelAssistantReplyTask } from "src/hooks/tasks/useLabelingTask";
|
|
|
|
const LabelAssistantReply = () => {
|
|
const { tasks, isLoading, trigger, reset } = useLabelAssistantReplyTask();
|
|
|
|
if (isLoading) {
|
|
return <LoadingScreen />;
|
|
}
|
|
|
|
if (tasks.length === 0) {
|
|
return <Container className="p-6 text-center text-gray-800">No tasks found...</Container>;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>Label Assistant Reply</title>
|
|
<meta name="description" content="Label Assistant Reply" />
|
|
</Head>
|
|
<Task key={tasks[0].task.id} task={tasks[0].task} trigger={trigger} mutate={reset} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default LabelAssistantReply;
|