<script setup>
import {ref} from "vue";
const props = defineProps(['widgets']);
const emit = defineEmits(['update']);
const widgetsData = ref(props.widgets);
const loading = ref(false);
const modal = ref(false);
const save = () => {
}
</script>
<template>
<el-button type="primary" size="large" class="p-4" @click="modal = true">
<el-icon :size="18">
<Setting/>
</el-icon>
</el-button>
<el-dialog title="Виджеты" v-model="modal" :append-to-body="true">
<template v-for="(widget, index) in widgetsData">
<el-card body-class="p-2" class="mb-2">
<div class="flex justify-between">
<div class="my-auto ms-4">{{ widget.name }}</div>
<div class="me-2 my-auto">
<el-switch size="small" v-model="widget.active" inline-prompt/>
</div>
</div>
</el-card>
</template>
<template #footer>
<el-button @click="save">Сохранить</el-button>
</template>
</el-dialog>
</template>