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

const userStore = useUserStore();
const { userProfile } = storeToRefs(userStore);
</script>

<template>
  <div class="user-info-container">
    <div class="user-info" @click="$router.push('/user/settings')">
      <ui-avatar class="size-14" />
      <div>
        <div class="user-name">
          {{ userProfile?.user?.email }}
        </div>
        <div class="user-uid mt-1 text-xs text-text-100">
          UID: {{ userProfile?.uid }}
        </div>
      </div>
    </div>
    <div class="link" @click="$router.push('/onchain-address')">
      <PrimeQrcode 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: center;
  gap: 4px;
}
.link {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qr-code {
  font-size: 1.5em;
}
ion-icon {
  font-size: 1em;
}
</style>
