Small fixes

This commit is contained in:
DrMint 2024-07-07 02:09:11 +02:00
parent 94c171d6bf
commit cc24134f37
3 changed files with 35 additions and 6 deletions

View File

@ -36,9 +36,13 @@ const { t, getLocalizedUrl } = await getI18n(currentLocale);
}
</p>
<div>
{credits.length > 0 && <Credits credits={credits} />}
</div>
{
credits.length > 0 && (
<div>
<Credits credits={credits} />
</div>
)
}
</Card>
{

View File

@ -7,7 +7,7 @@ interface Props {
href: string;
}
const { icon = "material-symbols:folder", title, href, lang } = Astro.props;
const { icon = "material-symbols:folder-open", title, href, lang } = Astro.props;
---
{/* ------------------------------------------- HTML ------------------------------------------- */}

View File

@ -14,9 +14,22 @@ if (response instanceof Response) {
}
Astro.locals.sdkCalls.add(response.endpointCalled);
const image = response.data;
const { filename, translations, attributes, credits, createdAt, updatedAt, mimeType } = image;
const {
filename,
translations,
attributes,
credits,
createdAt,
updatedAt,
mimeType,
filesize,
width,
height,
} = image;
const { getLocalizedMatch, formatDate, t } = await getI18n(Astro.locals.currentLocale);
const { getLocalizedMatch, formatDate, t, formatFilesize } = await getI18n(
Astro.locals.currentLocale
);
const { pretitle, title, subtitle, description, language } =
translations.length > 0
@ -40,6 +53,18 @@ const metaAttributes = [
},
]
: []),
{
title: t("global.media.attributes.resolution"),
icon: "material-symbols:photo-size-select-large",
values: [{ name: `${width} x ${height}` }],
withBorder: false,
},
{
title: t("global.media.attributes.filesize"),
icon: "material-symbols:hard-drive",
values: [{ name: formatFilesize(filesize) }],
withBorder: false,
},
{
title: t("global.media.attributes.createdAt"),
icon: "material-symbols:calendar-add-on",