'use client'
import { trpc } from '~/app/_trpc/Client'
import { useParams } from 'next/navigation'
import CreateUpdateBlogForm from '../_components/CreateUpdateForm'

export default function Page() {
  const { slug } = useParams<{ slug: string }>()
  const { data } = trpc.blog.bySlug.useQuery(slug)
  if (data) return <CreateUpdateBlogForm entity={data} />
  return <></>
}
