add time uploaded to the paste
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m4s
Publish Docker Image / docker (ubuntu-latest) (push) Successful in 57s

This commit is contained in:
Lee 2024-04-23 21:59:22 +01:00
parent 7b392a4be3
commit e9f63a369d
3 changed files with 17 additions and 5 deletions

@ -21,7 +21,7 @@ type Paste = {
/**
* The date the paste was created.
*/
created: number;
created: string;
/**
* The detected language of the paste.
@ -59,10 +59,13 @@ export async function generateMetadata({
description: "Not found",
};
}
const created = moment(data.created)
.format("MMMM Do YYYY, h:mm:ss a")
.toString();
return {
title: `Paste - ${id}.${data.language}`,
description: `Created: ${moment(data.created)}\n\nClick to view the paste.`,
description: `Created: ${created}\n\nClick to view the paste.`,
};
}
@ -75,11 +78,19 @@ export default async function Paste({
return notFound();
}
const created = moment(data.created)
.format("MMMM Do YYYY, h:mm:ss a")
.toString();
return (
<div className="relative">
<div className="relative h-full">
<div className="absolute top-0 right-0 flex flex-col items-end mx-3 mt-2">
<ActionMenu />
</div>
<div className="absolute right-0 bottom-0 text-right p-1.5">
<p>{data.language}</p>
<p>{created}</p>
</div>
<div className="p-1 hljs !bg-transparent text-sm">

@ -60,7 +60,7 @@ export default function Home(): ReactElement {
/>
</div>
<div className="absolute top-0 right-0 mx-3 mt-2">
<div className="absolute top-0 right-0 mx-3 mt-2 ">
<ActionMenu>
<Button onClick={() => createPaste()} className="flex gap-1">
{creating && (

@ -4,6 +4,7 @@ import { ThemeProvider } from "@/app/components/theme-provider";
import { ReactNode } from "react";
import { jetbrainsMono } from "@/app/common/font/font";
import { Toaster } from "@/app/components/ui/toaster";
import { cn } from "@/app/common/utils";
export const metadata: Metadata = {
title: "Paste",
@ -17,7 +18,7 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={jetbrainsMono.className}>
<body className={cn(jetbrainsMono.className, "w-screen h-screen")}>
<Toaster />
<ThemeProvider
attribute="class"