import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { db } from '@/db'
import { todoTable } from '@/db/schema'

const getTodos = createServerFn().handler(async () => {
  const todos = await db.query.todoTable.findMany()
  return todos
})

export const Route = createFileRoute('/todo')({
  component: Todo,
})

function Todo() {
  return <div>Hello "/todo"!</div>
}
