import React, { ReactElement } from "react"; import { ActionMenu } from "@/app/components/action-menu"; import { Metadata } from "next"; import moment from "moment"; import { notFound } from "next/navigation"; import { CodeBlock } from "@/app/components/code-block"; import { Button } from "@/app/components/ui/button"; import Link from "next/link"; import { generatePasteMetadata, getPaste, type Paste, } from "@/app/common/pastes"; import { PastePageProps } from "@/app/types/paste-page"; export async function generateMetadata({ params: { id }, }: PastePageProps): Promise { return generatePasteMetadata(id); } export default async function Paste({ params: { id }, }: PastePageProps): Promise { const data: Paste | undefined = await getPaste(id); if (data == undefined) { return notFound(); } const created = moment(data.created) .format("MMMM Do YYYY, h:mm:ss a") .toString(); return (
{/* Action Menu */} {/* Paste Details */}

{data.language}

{created}

{/* Paste Content */}
); }