import { getAvatarDrawing } from "@/app/www/logic/avatar";
import logIP from "@/app/www/media/logIP";
import { DEFAULT_AVATAR_ASSET } from "@/app/www/utilities/Path";

export const GET = logIP(async (req, { params: { avatarID } }) => {
  return new Response(
    (await getAvatarDrawing(avatarID)) ?? DEFAULT_AVATAR_ASSET,
    {
      headers: {
        ["content-type"]: "image/png",
      },
    },
  );
});
