import React, { useEffect, useState } from "react";
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";
import DetailDocument from "@/components/main/document-detail";

interface Size {
  label: string;
  value: string;
}

type Props = {
  params: {
    title: string;
    slug: string;
    description: string;
    thumbnailLink: string;
  };
};

export async function generateMetadata({ params }: any): Promise<Metadata> {
  const slug = String(params?.slug);
  const res = await getDetailMetaData(String(slug));
  const document = res?.data?.data;
  // console.log("image", image);
  return {
    title: document.title,
    description: document.description,
    openGraph: {
      title: document?.title,
      description: document?.description,
      images: [`${document?.thumbnailLink}`],
    },
  };
}

export default async function DetailInfo({ params }: Props) {
  return <DetailDocument />;
}
