feat(admin-images) : add standalone export generators
This commit is contained in:
@@ -6,6 +6,19 @@ import type { PublicGuide } from "@/lib/guides/queries";
|
||||
import { constellationChartRows } from "@/lib/guides/export-image";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export type ConstellationImageGuide = Pick<PublicGuide, "coverUrl"> & {
|
||||
character: Pick<PublicGuide["character"], "name" | "splashImageUrl">;
|
||||
};
|
||||
|
||||
export interface ConstellationImageGroup {
|
||||
note: string | null;
|
||||
rows: Array<{
|
||||
level: number;
|
||||
cumulativePercent: string;
|
||||
isGreat: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
function percentage(value: number): string {
|
||||
return `${value.toLocaleString("en-US", { maximumFractionDigits: 2 })}%`;
|
||||
}
|
||||
@@ -14,8 +27,8 @@ export function ConstellationImage({
|
||||
guide,
|
||||
group,
|
||||
}: {
|
||||
guide: PublicGuide;
|
||||
group: PublicGuide["constellationGroups"][number];
|
||||
guide: ConstellationImageGuide;
|
||||
group: ConstellationImageGroup;
|
||||
}) {
|
||||
const rows = constellationChartRows(group.rows);
|
||||
const background = guide.character.splashImageUrl ?? guide.coverUrl;
|
||||
|
||||
Reference in New Issue
Block a user