mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: admin page mii images not showing
This commit is contained in:
parent
70890a2ed5
commit
d0fe60067a
2 changed files with 11 additions and 4 deletions
|
|
@ -5,11 +5,10 @@ import { auth } from "@/lib/auth";
|
|||
|
||||
import BannerForm from "@/components/admin/banner-form";
|
||||
// import ControlCenter from "@/components/admin/control-center";
|
||||
import RegenerateImagesButton from "@/components/admin/regenerate-images";
|
||||
// import RegenerateImagesButton from "@/components/admin/regenerate-images";
|
||||
import UserManagement from "@/components/admin/user-management";
|
||||
import Reports from "@/components/admin/reports";
|
||||
import MiiList from "@/components/admin/mii-list";
|
||||
// import MiiList from "@/components/mii/list";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Admin - TomodachiShare",
|
||||
|
|
|
|||
|
|
@ -17,12 +17,10 @@ export default function MiiGrid({ miis, totalCount, lastPage }: Props) {
|
|||
|
||||
const acceptMii = async (id: number) => {
|
||||
await fetch(`/api/admin/accept-mii?id=${id}`, { method: "POST" });
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
const acceptMany = async (ids: number[]) => {
|
||||
await Promise.all(ids.map((id) => fetch(`/api/admin/accept-mii?id=${id}`, { method: "POST" })));
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
const rows: (typeof miis)[] = [];
|
||||
|
|
@ -69,6 +67,16 @@ export default function MiiGrid({ miis, totalCount, lastPage }: Props) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<div className="grid grid-cols-2 gap-1 rounded-xl bg-zinc-200">
|
||||
{[
|
||||
`/mii/${mii.id}/image?type=mii`,
|
||||
mii.platform === "THREE_DS" ? `/mii/${mii.id}/image?type=qr-code` : `/mii/${mii.id}/image?type=features`,
|
||||
...Array.from({ length: mii.imageCount }, (_, i) => `/mii/${mii.id}/image?type=image${i}`),
|
||||
].map((src, i) => (
|
||||
<img key={i} src={src} alt="mii image" className="w-full bg-zinc-200" />
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="p-4 flex flex-col gap-1 h-full">
|
||||
<div className="flex justify-between items-center">
|
||||
<Link
|
||||
|
|
|
|||
Loading…
Reference in a new issue