import { NextResponse } from "next/server"

export function badRequest(cause?: unknown) {
  const resInit = {
    status: 400,
    statusText: "Bad request",
  }

  return NextResponse.json(
    {
      cause,
    },
    resInit
  )
}

export function notFound(cause?: unknown) {
  const resInit = {
    status: 404,
    statusText: "Not found",
  }

  return NextResponse.json(
    {
      cause,
    },
    resInit
  )
}

export function internalServerError(cause?: unknown) {
  const resInit = {
    status: 500,
    statusText: "Internal Server Error",
  }

  return NextResponse.json(
    {
      cause,
    },
    resInit
  )
}
