import type { PropType } from 'vue';
import { defineComponent, onMounted, ref, watch } from 'vue'
import { useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import { useGlobalStore } from '@store/globalStore'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { tools } from '@tools'
import { costanti } from '@costanti'
import { CMyValueDb } from '@src/components/CMyValueDb'
import { IProduct, IRecFields } from 'app/src/model';


export default defineComponent({
  name: 'CTableCupleLabelValue',
  emits: ['updateproductmodif'],
  props: {
    title: {
      type: String,
      required: false,
      default: '',
    },
    list: {
      type: Array as PropType<IRecFields[]>,
      required: true,
    }
  },
  components: { CMyValueDb },
  setup(props, { emit }) {
    const $q = useQuasar()
    const { t } = useI18n()
    const globalStore = useGlobalStore()

    function mounted() {

    }

    function updateproductmodif(element: any) {
      // console.log('CTABLECUPLE updateproductmodif ', element)
      emit('updateproductmodif', element)
    }

    onMounted(mounted)

    return {
      tools,
      costanti,
      fieldsTable,
      globalStore,
      updateproductmodif,
    }
  },
})

