"use client"

import { useParams } from "next/navigation"
import { UltidrawEditor } from "@/components/drive/ultidraw-editor"
import { isDriveFileIdSegment } from "@/lib/drive/drive-url"

export default function DriveDrawEditPage() {
  const params = useParams()
  const fileId = params.fileId as string

  if (!isDriveFileIdSegment(fileId)) {
    return (
      <div className="flex h-dvh items-center justify-center p-8 text-sm text-muted-foreground">
        Identifiant de dessin invalide
      </div>
    )
  }

  return <UltidrawEditor fileId={fileId} />
}
