"use client"

import { useQuery } from "@tanstack/react-query"
import { fetchPublicShare } from "@/lib/api/public-share"

export function usePublicShare(token: string, path: string, password?: string) {
  return useQuery({
    queryKey: ["public-share", token, path, password ?? ""],
    queryFn: () => fetchPublicShare(token, path, password),
    enabled: Boolean(token),
    retry: false,
  })
}
