/** What a failed detail read should do — pure, so it can be tested. */
export function learnServeReadErrorAction(
  error: unknown,
  hasData: boolean
): "redirect" | "toast" | "none" {
  if (!error) return "none";
  const status = (error as { response?: { status?: number } }).response?.status;
  if (status === 404) return "redirect";
  return hasData ? "toast" : "none";
}
