<script lang='ts' setup>
import { chevronForwardOutline, copyOutline, qrCodeOutline } from "ionicons/icons";

const { user } = useAuth();
</script>

<template>
  <div class="user-info-container">
    <div class="user-info">
      <ui-avatar class="size-18" />
      <div>
        <div class="user-name">
          {{ user?.email }}
        </div>
        <div class="user-uid mt-2 text-sm text-text-100">
          UID: 95223143 <ion-icon :icon="copyOutline" />
        </div>
      </div>
    </div>
    <div class="link" @click="$router.push('/onchain-address')">
      <ion-icon :icon="qrCodeOutline" class="qr-code" />
      <ion-icon :icon="chevronForwardOutline" />
    </div>
  </div>
</template>

<style scoped>
.user-info-container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.user-name {
  font-weight: 600;
  font-size: 1.3em;
}
.user-uid {
  color: var(--ion-text-secondary);
  display: flex;
  align-items: end;
  gap: 4px;
}
.link {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qr-code {
  font-size: 1.5em;
}
ion-icon {
  font-size: 1em;
}
</style>
