<script lang="ts">
  import Button from "./Button.svelte";

  const { onInstall } = $props<{ onInstall: () => void }>();
</script>

<div class="install-prompt-overlay">
  <div class="install-prompt">
    <img src="/favicon.png" alt="Portal BTC Logo" class="logo" />
    <h2>Install Portal BTC Wallet</h2>
    <p>
      The Portal BTC Wallet works best when installed as a progressive web
      application. Click the button below to install the Portal BTC Wallet app
      on your device.
    </p>
    <Button onclick={onInstall}>Install App</Button>
  </div>
</div>

<style>
  .logo {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
  }

  .install-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .install-prompt {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
    border: 2px solid #444;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  }

  h2 {
    margin-bottom: 1rem;
    color: #fff;
  }

  p {
    margin-bottom: 2rem;
    color: #ccc;
  }
</style>
