Start work on adding meta data to images
This commit is contained in:
parent
acfcba4d82
commit
50881fc943
@ -1,5 +1,6 @@
|
|||||||
import { Button } from "@nextui-org/react";
|
import { Button } from "@nextui-org/react";
|
||||||
import moment from "moment/moment";
|
import moment from "moment/moment";
|
||||||
|
import { NextSeo } from "next-seo";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getFileInfo } from "src/utils/helpers/fileHelpers";
|
import { getFileInfo } from "src/utils/helpers/fileHelpers";
|
||||||
@ -22,9 +23,13 @@ export default function File(props) {
|
|||||||
size,
|
size,
|
||||||
} = file;
|
} = file;
|
||||||
|
|
||||||
|
const metaData = <NextSeo title={`${fileId}.${ext}`} />;
|
||||||
|
|
||||||
let toShow;
|
let toShow;
|
||||||
if (!isValidFile) {
|
if (!isValidFile) {
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{metaData}
|
||||||
<div className="h-screen flex items-center justify-center">
|
<div className="h-screen flex items-center justify-center">
|
||||||
<div className="flex flex-col text-center 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>
|
<h1 className="text-red-500 text-3xl mb-5">Invalid File</h1>
|
||||||
@ -35,6 +40,7 @@ export default function File(props) {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (isValidFile) {
|
if (isValidFile) {
|
||||||
@ -56,6 +62,8 @@ export default function File(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{metaData}
|
||||||
<div className="h-screen flex items-center justify-center">
|
<div className="h-screen flex items-center justify-center">
|
||||||
<div className="flex flex-col items-center justify-center">
|
<div className="flex flex-col items-center justify-center">
|
||||||
<h1 className="font-bold text-lg">
|
<h1 className="font-bold text-lg">
|
||||||
@ -66,7 +74,10 @@ export default function File(props) {
|
|||||||
Uploader: <span className="font-bold">{uploader.username}</span> -{" "}
|
Uploader: <span className="font-bold">{uploader.username}</span> -{" "}
|
||||||
{formatBytes(size)}
|
{formatBytes(size)}
|
||||||
</h3>
|
</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
|
<Button
|
||||||
auto
|
auto
|
||||||
className="bg-blue-600 mt-5"
|
className="bg-blue-600 mt-5"
|
||||||
@ -76,8 +87,10 @@ export default function File(props) {
|
|||||||
>
|
>
|
||||||
Download
|
Download
|
||||||
</Button>
|
</Button>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user