import { A, useParams } from "@solidjs/router"; import { createEffect, createResource, For, Suspense } from "solid-js"; import { getUserImages } from "./network"; export function ImagePage() { const { imageId } = useParams<{ imageId: string }>(); const [image] = createResource(async () => { const userImages = await getUserImages(); const currentImage = userImages.find((image) => image.ID === imageId); if (currentImage == null) { // TODO: this error handling. throw new Error("must be valid"); } return currentImage; }); createEffect(() => { console.log(image()); }); return ( Loading...}> Back

{image()?.Image.ImageName}

link

Tags

{(tag) =>
{tag.Tag.Tag}
}

Locations

{(location) => (
  • {location.Name}
  • {location.Address &&
  • {location.Address}
  • } {location.Coordinates && (
  • {location.Coordinates}
  • )} {location.Description && (
  • {location.Description}
  • )}
)}

Events

{(event) => (
  • {event.Name}
  • {event.Location &&
  • {event.Location.Name}
  • } {event.Description &&
  • {event.Description}
  • }
)}
); }