aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/items/create/+page.svelte
blob: ddb72eb566920b8888b9e7f987adef310fb8388e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script lang="ts">
  import { run } from "svelte/legacy";

  import { t } from "$lib/translations";
  import ItemForm from "$comp/ItemForm.svelte";
  import { fail } from "$lib/utils";

  let { data, form } = $props();

  run(() => {
    form?.message && fail(form.message);
  });
  let user = $derived(data.user);
  let item = {};
</script>

<div class="container max-w-xl mx-auto px-4">
  <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold mb-10">
    {$t("items.add")}
  </h1>
  <ItemForm {item} {user} />
</div>