feat: add viewing of all collections of users, releases and favorite collections

This commit is contained in:
Kentai Radiquum 2024-08-13 17:14:32 +05:00
parent c1204473ec
commit 3de552f271
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
6 changed files with 248 additions and 7 deletions

View file

@ -0,0 +1,42 @@
import { CollectionsFullPage } from "#/pages/CollectionsFull";
import { fetchDataViaGet } from "#/api/utils";
import type { Metadata, ResolvingMetadata } from "next";
export async function generateMetadata(
{ params },
parent: ResolvingMetadata
): Promise<Metadata> {
const id: string = params.id;
const profile: any = await fetchDataViaGet(
`https://api.anixart.tv/profile/${id}`
);
const previousOG = (await parent).openGraph;
return {
title: "Коллекции - " + profile.profile.login,
description: profile.profile.status,
openGraph: {
...previousOG,
images: [
{
url: profile.profile.avatar, // Must be an absolute URL
width: 600,
height: 600,
},
],
},
};
}
export default async function Collections({ params }) {
const profile: any = await fetchDataViaGet(
`https://api.anixart.tv/profile/${params.id}`
);
return (
<CollectionsFullPage
type="profile"
title={`Коллекции пользователя ${profile.profile.login}`}
profile_id={params.id}
/>
);
}