<script lang="ts">
  // Bottone tondo fisso in basso a destra per l'azione principale della pagina.
  import Icona, { type NomeIcona } from './Icona.svelte';

  let { etichetta, icona = 'piu', onclick, href }: { etichetta: string; icona?: NomeIcona; onclick?: () => void; href?: string } =
    $props();
  const classi =
    'fixed right-4 bottom-[max(1rem,calc(env(safe-area-inset-bottom)+0.5rem))] z-20 flex size-14 items-center justify-center rounded-full bg-(--accento) text-white shadow-lg transition hover:brightness-110 active:scale-95';
</script>

{#if href}
  <a {href} class={classi} aria-label={etichetta}><Icona nome={icona} classe="size-7" /></a>
{:else}
  <button type="button" class={classi} aria-label={etichetta} {onclick}><Icona nome={icona} classe="size-7" /></button>
{/if}
