import React from 'react'
import TaskDetailComponent from "../components/taskDetailModal/main"
import { serverClient } from '@ulld/api/serverClient'
import { redirect } from "next/navigation"
import { todoTaskSchema } from '@ulld/parsers/plugins/todos'

interface TestPageProps {

}

const taskId = 1

const TestPage = async (props: TestPageProps) => {
    let t = await serverClient.toDo.getToDoDetails({
        toDoId: typeof taskId === "string" ? parseInt(taskId) : taskId,
    });

    if (!t) return redirect("/todo")
    const task = await todoTaskSchema.parseAsync(t)

    return (
        <TaskDetailComponent
            isModal={true}
            data={task}
        />
    )
}


TestPage.displayName = "TestPage"


export default TestPage;
