import { ref, computed } from 'vue'
import { defineStore } from 'pinia'


const useDeveics = defineStore('device', () => {
    const devices = ref({
        id: '',
        status: false,
        type: "",
        device: {}
    })
    const setDevice = (info) => {
        devices.value = info
    }
    const getDevice = computed(() => {
        return devices.value
    })
    return { devices, setDevice, getDevice }
})

const useUploaders = defineStore('uploader', () => {
    const uploaders = ref({
        id: '',
        status: false,
        version: ""
    })
    const setUploader = (info) => {
        uploaders.value = info
    }
    const getUploader = computed(() => {
        return uploaders.value
    })
    return { uploaders, setUploader, getUploader }
})

const usePrintData = defineStore('print', () => {
    const data = ref([])
    return { data }
})

export default { useDeveics, useUploaders, usePrintData }