import type { PropType } from 'vue';
import { defineComponent, onMounted, ref, watch } from 'vue'
import { tools } from '@src/store/Modules/tools'
import { CCurrencyValue } from '../CCurrencyValue'

import { useCircuitStore } from '@store/CircuitStore'
import { date, useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import type { IAccount } from 'model';
import { ISpecialField } from 'model'
import { CMyFieldDb } from '@src/components/CMyFieldDb'
import { CMyFieldRec } from '@src/components/CMyFieldRec'
import { colTableNotifCoins } from '@store/Modules/fieldsTable'
import { costanti } from '@costanti'

export default defineComponent({
  name: 'CSaldo',
  props: {
    small: {
      type: Boolean,
      default: false,
    },
    symbol: {
      type: String,
      required: true,
    },
    valueextra: {
      type: String,
      required: false,
      default: '',
    },
    saldo: {
      type: Number,
      required: true,
      default: 0,
    },
    account: {
      type: Object as PropType<IAccount>,
      required: false,
      default: null,
    },
    qtarem: {
      type: Number,
      required: false,
      default: 0,
    },
    color: {
      type: String,
      required: false,
      default: '',
    },
    paramTypeAccount: {
      type: Number,
      required: false,
      default: 0,
    },
  },
  components: { CCurrencyValue, CMyFieldRec },
  setup(props, { emit }) {
    const $q = useQuasar()
    const { t } = useI18n()
    const color_border = ref('red')

    const showingtooltip = ref(false)
    const visuTransac = ref(false)

    const circuitStore = useCircuitStore()

    function created() {
      // created
    }

    onMounted(created)

    return {
      showingtooltip,
      t,
      colTableNotifCoins,
      tools,
      color_border,
      visuTransac,
      costanti,
      circuitStore,
    }
  },
})
