Skip to content
Snippets Groups Projects
Commit 8db3f353 authored by Trirst's avatar Trirst
Browse files

Image metadata display in image post

parent dbc3ac59
No related branches found
No related tags found
No related merge requests found
<script>
import { fetchAPI } from "@/static/js/helper";
import { paths } from "@/static/js/paths";
import { onMount } from "svelte";
export let params = {};
let imageMetadata = {};
async function getImageMetadata() {
return await fetchAPI(paths.ImageField(params.snowflake));
}
onMount(async () => {
imageMetadata = await getImageMetadata();
});
</script>
<img src={paths.ImageFile(params.snowflake)} alt="" />
<div class="flex flex-row space-x-12">
<ul class="pl-2">
<li><strong>Snowflake: </strong> {imageMetadata.snowflake}</li>
<li><strong>Source: </strong> {imageMetadata.source}</li>
<li><strong>Image type: </strong> {imageMetadata.type}</li>
<li><strong>Uploaded by: </strong> {imageMetadata.user}</li>
</ul>
<img src={paths.ImageFile(params.snowflake)} alt="" class="max-w-2xl" />
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment