diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-01-14 12:02:10 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-01-14 12:02:10 +0900 |
| commit | 45462e4a5e8b94be110968afb2985bb145d7b6b3 (patch) | |
| tree | 96ed48c7098e6946347f21bf23ffb56126a7e9f5 /packages/client/src/components/user-online-indicator.vue | |
| parent | wip: refactor(client): migrate paging components to composition api (diff) | |
| download | misskey-45462e4a5e8b94be110968afb2985bb145d7b6b3.tar.gz misskey-45462e4a5e8b94be110968afb2985bb145d7b6b3.tar.bz2 misskey-45462e4a5e8b94be110968afb2985bb145d7b6b3.zip | |
wip: refactor(client): migrate paging components to composition api
Diffstat (limited to 'packages/client/src/components/user-online-indicator.vue')
| -rw-r--r-- | packages/client/src/components/user-online-indicator.vue | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/packages/client/src/components/user-online-indicator.vue b/packages/client/src/components/user-online-indicator.vue index 93e9dea57b..a87b0aeff5 100644 --- a/packages/client/src/components/user-online-indicator.vue +++ b/packages/client/src/components/user-online-indicator.vue @@ -2,26 +2,21 @@ <div v-tooltip="text" class="fzgwjkgc" :class="user.onlineStatus"></div> </template> -<script lang="ts"> -import { defineComponent } from 'vue'; +<script lang="ts" setup> +import { } from 'vue'; +import * as misskey from 'misskey-js'; +import { i18n } from '@/i18n'; -export default defineComponent({ - props: { - user: { - type: Object, - required: true - }, - }, +const props = defineProps<{ + user: misskey.entities.User; +}>(); - computed: { - text(): string { - switch (this.user.onlineStatus) { - case 'online': return this.$ts.online; - case 'active': return this.$ts.active; - case 'offline': return this.$ts.offline; - case 'unknown': return this.$ts.unknown; - } - } +const text = $computed(() => { + switch (props.user.onlineStatus) { + case 'online': return i18n.locale.online; + case 'active': return i18n.locale.active; + case 'offline': return i18n.locale.offline; + case 'unknown': return i18n.locale.unknown; } }); </script> |