import { defineComponent, ref, toRef, watch } from 'vue'
import { tools } from '@src/store/Modules/tools'

import { useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import { toolsext } from '@store/Modules/toolsext'

export default defineComponent({
  name: 'CSelectColor',
  emits: ['update:modelValue'],
  props: {
    modelValue: {
      type: String,
      required: false,
      default: '',
    },
    title: {
      type: String,
      required: false,
      default: '',
    },
  },
  components: {},
  setup(props, { emit }) {
    const $q = useQuasar()
    const { t } = useI18n();

    const color = toRef(props, 'modelValue')

    function updateValue(str: string) {
      emit('update:modelValue', str)
    }

    return {
      tools,
      toolsext,
      updateValue,
      color,
    }
  },
})
