<script lang="ts">
    import type { PageProps } from "./$types.js";
    import EditPhotoForm from "./EditPhotoForm.svelte";

  const { data, form }: PageProps = $props()

  const success = form?.success ?? false;
</script>

<div>
  <a class="breadcrumb" href="/admin/photos">Photos</a>
  <h1>{data.photo.title}</h1>

  <EditPhotoForm photo={data.photo} />

  {#if success}
      <p>Photo updated successfully!</p>
  {/if}
</div>
