Start work on adding meta data to images

This commit is contained in:
Lee 2022-11-17 05:59:53 +00:00
parent acfcba4d82
commit 50881fc943
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -1,5 +1,6 @@
import { Button } from "@nextui-org/react";
import moment from "moment/moment";
import { NextSeo } from "next-seo";
import Image from "next/image";
import Link from "next/link";
import { getFileInfo } from "src/utils/helpers/fileHelpers";
@ -22,9 +23,13 @@ export default function File(props) {
size,
} = file;
const metaData = <NextSeo title={`${fileId}.${ext}`} />;
let toShow;
if (!isValidFile) {
return (
<>
{metaData}
<div className="h-screen flex items-center justify-center">
<div className="flex flex-col text-center items-center justify-center">
<h1 className="text-red-500 text-3xl mb-5">Invalid File</h1>
@ -35,6 +40,7 @@ export default function File(props) {
</Link>
</div>
</div>
</>
);
}
if (isValidFile) {
@ -56,6 +62,8 @@ export default function File(props) {
}
return (
<>
{metaData}
<div className="h-screen flex items-center justify-center">
<div className="flex flex-col items-center justify-center">
<h1 className="font-bold text-lg">
@ -66,7 +74,10 @@ export default function File(props) {
Uploader: <span className="font-bold">{uploader.username}</span> -{" "}
{formatBytes(size)}
</h3>
<div className="md:w-4/6 md:h-4/6 sm:w-fit sm:h-fit mt-3">{toShow}</div>
<div className="md:max-w-[70%] sm:w-fit sm:h-fit mt-3 items-center justify-center">
{toShow}
</div>
{!toShow ? (
<Button
auto
className="bg-blue-600 mt-5"
@ -76,8 +87,10 @@ export default function File(props) {
>
Download
</Button>
) : null}
</div>
</div>
</>
);
}