mediahub-fe/app/[locale]/(public)/video/detail/[slug]/page.tsx

71 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-12-13 14:33:59 +00:00
import React, { useEffect, useState } from "react";
2025-05-06 06:21:11 +00:00
import {
checkWishlistStatus,
createPublicSuggestion,
deletePublicSuggestion,
deleteWishlist,
getDetail,
getDetailMetaData,
getPublicSuggestionList,
saveWishlist,
} from "@/service/landing/landing";
import { Metadata } from "next";
import DetailImage from "@/components/main/image-detail";
import DetailVideo from "@/components/main/video-detail";
2025-02-20 09:31:43 +00:00
interface Size {
label: string;
value: string;
}
2025-05-06 06:21:11 +00:00
type Props = {
params: {
title: string;
slug: string;
description: string;
thumbnailLink: string;
};
2025-05-06 06:21:11 +00:00
};
2025-05-06 06:21:11 +00:00
export async function generateMetadata({ params }: any): Promise<Metadata> {
const slug = String(params?.slug);
const res = await getDetailMetaData(String(slug));
const video = res?.data?.data;
// console.log("video", video);
return {
title: video.title,
description: video.description,
2025-10-08 04:34:15 +00:00
// openGraph: {
// title: video?.title,
// description: video?.description,
// videos: [`${video?.smallThumbnailLink}`],
// },
2025-05-06 06:21:11 +00:00
openGraph: {
title: video?.title,
description: video?.description,
2025-10-08 04:34:15 +00:00
url: `https://mediahub.polri.go.id/in/video/detail/${slug}`,
type: "video.other",
images: [
{
url: video?.thumbnailLink,
width: 1280,
height: 720,
alt: video?.title || "Thumbnail Mediahub Polri",
},
],
},
twitter: {
card: "summary_large_image",
title: video?.title,
description: video?.description,
images: [
video?.thumbnailLink,
],
2025-05-06 06:21:11 +00:00
},
};
2025-05-06 06:21:11 +00:00
}
2025-05-06 06:21:11 +00:00
export default async function DetailInfo({ params }: Props) {
return <DetailVideo />;
}