aboutsummaryrefslogtreecommitdiffstats
path: root/src/params/uuid.js
blob: 1278e59ed4e455a68398957399d1d28835abf642 (plain) (blame)
1
export let match = (p) => p.split('-').length > 4;
color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
<script>
  import { run } from "svelte/legacy";

  import { goto } from "$app/navigation";
  import Icon from "$comp/Icon.svelte";
  import Balance from "$comp/Balance.svelte";
  import { t } from "$lib/translations";

  let { user, rate, account, last } = $props();
  let { name, seed, balance, id } = $derived(account);

  let setAccount = () => (document.cookie = `aid=${id}; path=/; max-age=86400`);
  let go = () => {
    setAccount();
    goto("/payments");
  };
  let type = $derived(seed ? "Savings" : "Cash");
</script>

<div
  class="block space-y-2 border-primary py-4"
  class:border-b-8={!last}
  aria-label="Payments"
>
  <div class="flex">
    <Balance {balance} {user} {rate} />
    <a
      href={`/payments`}
      class="contents"
      onclick={setAccount}
      aria-label="Payments"
    >
      <button class="ml-auto flex gap-1 mb-auto pb-4 pl-4">
        <iconify-icon icon="ph:clock-bold" width="32" aria-label="Payments"
        ></iconify-icon>
      </button>
    </a>
    <a href={`/account/${id}`} class="contents" aria-label="Settings">
      <button class="flex gap-1 mb-auto pb-4 pl-4">
        <iconify-icon icon="ph:gear-bold" width="32" aria-label="Settings"
        ></iconify-icon>
      </button>
    </a>
  </div>

  <div class="flex justify-center w-full text-xl gap-2">
    <a href={"/invoice"} class="contents" onclick={setAccount}>
      <button class="btn !w-auto flex-grow">
        <iconify-icon icon="ph:hand-coins-bold" width="32" flip="horizontal"
        ></iconify-icon>
        <div class="my-auto">{$t("user.dashboard.receive")}</div>
      </button>
    </a>

    <a href={`/send`} class="contents grow" onclick={setAccount}>
      <button type="button" class="btn !w-auto flex-grow">
        <iconify-icon icon="ph:paper-plane-right-bold" width="32"
        ></iconify-icon>
        <div class="my-auto">{$t("user.dashboard.send")}</div>
      </button>
    </a>
  </div>
</div>