import { GetServerSidePropsContext } from "next/types";

export default function errorProps(
  context: GetServerSidePropsContext,
  code = 404,
  otherProps: Docs = {}
) {
  context.res.statusCode = code;
  return {
    props: {
      statusCode: code,
      ...otherProps,
    },
  };
}
