Add image display to flight logs

This commit is contained in:
april
2024-01-15 11:52:29 -06:00
parent 4b80593aa3
commit 2395bb10bf
8 changed files with 107 additions and 8 deletions

View File

@@ -45,10 +45,12 @@ function useFetchImageAsBase64(
export default function SecureImage({
id,
radius = "sm",
h = "",
clickable = true,
}: {
id: string;
radius?: string;
h?: string;
clickable?: boolean;
}) {
const { isLoading, error, data } = useFetchImageAsBase64(id);
@@ -57,7 +59,7 @@ export default function SecureImage({
if (isLoading)
return (
<Center h="100%">
<Center h="500px">
<Loader />
</Center>
);
@@ -80,6 +82,12 @@ export default function SecureImage({
<Image
src={`data:${data?.type};base64,${data?.blob}`}
radius={radius}
w="auto"
maw="100%"
h="100%"
m="auto"
fit="contain"
style={{ maxHeight: h ?? "" }}
onClick={() => {
if (clickable) {
open();