import type { Metadata } from "next"; import Link from "next/link"; import { redirect } from "next/navigation"; import { ActionForm, SubmitButton } from "@/components/forms"; import { PageHeader, Tag } from "@/components/status"; import { ShopListing } from "@/components/shop-listing"; import { DateTime } from "@/components/time"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Field, FieldDescription, FieldLabel } from "@/components/ui/field"; import { Input } from "@/components/ui/input"; import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Textarea } from "@/components/ui/textarea"; import { api, getMe, unwrap, type ImportGrant } from "@/lib/api"; import { changeGrant, createGrant, requestProduct } from "./actions"; export const metadata: Metadata = { title: "Imports" }; const statusTone = { pending: "neutral", active: "online", declined: "danger", suspended: "danger", withdrawn: "neutral", } as const; const imvuPage = (id: number) => `https://www.imvu.com/shop/product.php?products_id=${id}`; export default async function Imports() { const me = await getMe(); if (!me) redirect("/signin?next=/imports"); const [account, offered, mine] = await Promise.all([ api.account.get().then(unwrap), api.imports.catalogs.get().then(unwrap), api.imports.grants.get().then(unwrap), ]); const asked = await Promise.all( account.links.map(async (l) => ({ link: l, requests: unwrap(await api.imports.requests.get({ query: { imvuCreator: l.imvuId } })).requests, })), ); const open = mine.grants.filter((g) => g.status !== "withdrawn" && g.status !== "declined"); const ended = mine.grants.filter((g) => g.status === "withdrawn" || g.status === "declined"); return (
Creators can let T5DE users wear their IMVU products for free: a catalog imports them, with their permission. Ask for a Product An IMVU product you'd like on T5DE. If its creator lets T5DE have it, it comes to your library; if not, they'll see that people asked.
Ask
{open.length > 0 && ( Your Products on T5DE {open.map((g) => ( ))} )} Bring Your IMVU Products Made products on IMVU? Choose a catalog to host them. Its team accepts first; then T5DE users can wear them for free, and you can change what's included or stop any time. {account.links.length === 0 ? (

First{" "} link your IMVU account , the one that made the products.

) : offered.catalogs.length === 0 ? (

No catalog takes imports yet.

) : (
Your IMVU account {account.links.map((l) => ( {l.username} ))} Catalog {offered.catalogs.map((c) => ( {c.name} ))}
What to bring
Leave out (whole shop)