import {
  shouldOpenInOnlyOffice,
  shouldOpenInRichTextEditor,
  shouldOpenInUltidrawEditor,
} from "@/lib/drive/drive-preview"

/** Best-effort guess from a public share URL path (before API metadata). */
export function sharePathLooksLikeEditorFile(path: string): boolean {
  const name = path.replace(/^\/+|\/+$/g, "").split("/").pop() ?? ""
  if (!name) return false
  return (
    shouldOpenInRichTextEditor({ name }) ||
    shouldOpenInUltidrawEditor({ name }) ||
    shouldOpenInOnlyOffice({ name })
  )
}
