import { ImageResponse } from "next/og" import General from "@/icons/general.js" import Teen from "@/icons/teen.js" import Mature from "@/icons/mature.js" import Explicit from "@/icons/explicit.js" import NotRated from "@/icons/notrated.js" import Gen from "@/icons/gen.js" import Yaoi from "@/icons/yaoi.js" import Yuri from "@/icons/yuri.js" import Het from "@/icons/het.js" import OtherShip from "@/icons/other.js" import MultiShip from "@/icons/multi.js" import NoWarnings from "@/icons/nowarnings.js" import Warnings from "@/icons/warnings.js" import ChoseNotToWarn from "@/icons/chosenottowarn.js" export default async function OGImage ({ theme, baseFont, titleFont, image, addr, opts }) { return new ImageResponse( (
{image.topLine}
{image.props.get('rating') === 'true' && image.rating === 'E' && ()} {image.props.get('rating') === 'true' && image.rating === 'M' && ()} {image.props.get('rating') === 'true' && image.rating === 'T' && ()} {image.props.get('rating') === 'true' && image.rating === 'G' && ()} {image.props.get('rating') === 'true' && image.rating === 'NR' && ()} {image.props.get('warnings') === 'true' && image.warning === 'NW' && ()} {image.props.get('warnings') === 'true' && image.warning === 'CNTW' && ()} {image.props.get('warnings') === 'true' && image.warning === 'W' && ()} {image.props.get('category') === 'true' && image.category === 'F' && ()} {image.props.get('category') === 'true' && image.category === 'M' && ()} {image.props.get('category') === 'true' && image.category === 'FM' && ()} {image.props.get('category') === 'true' && image.category === 'G' && ()} {image.props.get('category') === 'true' && image.category === 'MX' && ()} {image.props.get('category') === 'true' && image.category === 'O' && ()}
{image.titleLine}
{`by ${image.authorLine}`}
{image.chapterLine}
{image.props.get("charTags") === 'true' && (
{image.charTags.map(c => ( {c} ))}
)} {image.props.get("relTags") === 'true' && (
{image.relTags.map(r => ( {r} ))}
)} {image.props.get("freeTags") === 'true' && (
{image.freeTags.map(f => ( {f} ))}
)} {image.props.get("summary") === 'true' && (
{image.summary.map(l => (
{l}
))}
)}
{image.props.get("wordcount") === 'true' && `${image.words} words • `}{(image.props.get("chapters") === 'true' && image.chapterCount !== null) && `${image.chapterCount} chapters • `}{image.props.get("postedAt") === 'true' && `posted on ${image.postedAt} • `}{image.props.get("updatedAt") === 'true' && `updated on ${image.updatedAt} • `}{process.env.ARCHIVE}/{addr}
), opts ) }