mizzkey/packages/frontend/src/pages/settings/statusbar.vue
Kagami Sascha Rosylight 63df2c851e
refactor: remove all unused imports (#9951)
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2023-02-16 23:09:41 +09:00

53 lines
1.2 KiB
Vue

<template>
<div class="_gaps_m">
<MkFolder v-for="x in statusbars" :key="x.id">
<template #label>{{ x.type ?? i18n.ts.notSet }}</template>
<template #suffix>{{ x.name }}</template>
<XStatusbar :_id="x.id" :user-lists="userLists"/>
</MkFolder>
<MkButton primary @click="add">{{ i18n.ts.add }}</MkButton>
</div>
</template>
<script lang="ts" setup>
import { onMounted } from 'vue';
import { v4 as uuid } from 'uuid';
import XStatusbar from './statusbar.statusbar.vue';
import MkFolder from '@/components/MkFolder.vue';
import MkButton from '@/components/MkButton.vue';
import * as os from '@/os';
import { defaultStore } from '@/store';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
const statusbars = defaultStore.reactiveState.statusbars;
let userLists = $ref();
onMounted(() => {
os.api('users/lists/list').then(res => {
userLists = res;
});
});
async function add() {
defaultStore.push('statusbars', {
id: uuid(),
type: null,
black: false,
size: 'medium',
props: {},
});
}
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({
title: i18n.ts.statusbar,
icon: 'ti ti-list',
bg: 'var(--bg)',
});
</script>