mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-12 00:40:07 +08:00
30 lines
891 B
TypeScript
30 lines
891 B
TypeScript
import Head from "next/head";
|
|
import { Container } from "src/components/Container";
|
|
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
|
|
import { Task } from "src/components/Tasks/Task";
|
|
import { useCreatePrompterReply } from "src/hooks/tasks/useCreateReply";
|
|
|
|
const UserReply = () => {
|
|
const { tasks, isLoading, reset, trigger } = useCreatePrompterReply();
|
|
|
|
if (isLoading) {
|
|
return <LoadingScreen text="Loading..." />;
|
|
}
|
|
|
|
if (tasks.length === 0) {
|
|
return <Container className="p-6 text-center text-gray-800">No tasks found...</Container>;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>Reply as Assistant</title>
|
|
<meta name="description" content="Reply as Assistant." />
|
|
</Head>
|
|
<Task key={tasks[0].task.id} frontendId={tasks[0].id} task={tasks[0].task} trigger={trigger} mutate={reset} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default UserReply;
|