diff options
Diffstat (limited to 'packages/frontend/src/components/SkMutedNote.vue')
| -rw-r--r-- | packages/frontend/src/components/SkMutedNote.vue | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/frontend/src/components/SkMutedNote.vue b/packages/frontend/src/components/SkMutedNote.vue new file mode 100644 index 0000000000..4336a3abdc --- /dev/null +++ b/packages/frontend/src/components/SkMutedNote.vue @@ -0,0 +1,46 @@ +<!-- +SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors +SPDX-License-Identifier: AGPL-3.0-only +--> + +<template> +<I18n v-if="muted === 'sensitiveMute'" :src="i18n.ts.userSaysSomethingSensitive" tag="small"> + <template #name> + <MkUserName :user="note.user"/> + </template> +</I18n> +<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small"> + <template #name> + <MkUserName :user="note.user"/> + </template> +</I18n> +<I18n v-else :src="i18n.ts.userSaysSomethingAbout" tag="small"> + <template #name> + <MkUserName :user="note.user"/> + </template> + <template #word> + {{ mutedWords }} + </template> +</I18n> +</template> + +<script setup lang="ts"> +import * as Misskey from 'misskey-js'; +import { computed } from 'vue'; +import { i18n } from '@/i18n.js'; +import { prefer } from '@/preferences.js'; + +const props = defineProps<{ + muted: false | 'sensitiveMute' | (string | string[])[]; + note: Misskey.entities.Note; + +}>(); + +const mutedWords = computed(() => Array.isArray(props.muted) + ? props.muted.map(words => Array.isArray(words) ? words.join() : words).join(' ') + : props.muted); +</script> + +<style module lang="scss"> + +</style> |