<script lang='ts' setup>
import type { MyIssueRwaData } from "@/api/types";

const props = defineProps<{
  data: MyIssueRwaData | null;
}>();

const { t } = useI18n();
</script>

<template>
  <div class="mt-2">
    <!-- Rwa about -->
    <div class="mt-5">
      <div class="font-semibold">
        {{ t('market.tradeRwa.about') }}
      </div>
      <div class="text-xs mt-2">
        {{ data?.description || t('market.tradeRwa.noDescription') }}
      </div>
    </div>

    <!-- Rwa fields -->
    <ion-grid class="mt-5 text-sm space-y-5">
      <ion-row>
        <ion-col>
          <div class="label">
            {{ t('market.tradeRwa.fields.productCode') }}
          </div>
          <div>{{ data?.code }}</div>
        </ion-col>
        <ion-col>
          <div class="label">
            {{ t('market.tradeRwa.fields.valuation') }}
          </div>
          <div>${{ formatAmountWithUnit(data?.estimatedValue) }}</div>
        </ion-col>
      </ion-row>
    </ion-grid>

    <!-- Rwa status -->
    <div class="mt-5">
      <div class="font-semibold">
        资产状态
      </div>
      <div class="text-xs mt-2">
        {{ data?.status }}
      </div>
    </div>

    <!-- Rwa status history -->
    <div class="mt-5">
      <div class="font-semibold">
        状态历史
      </div>
    </div>
  </div>
</template>

<style lang='css' scoped></style>
