From b52db71e1894e25cebfafc782d2cec86705e2cbb Mon Sep 17 00:00:00 2001
From: Hazelnoot <acomputerdog@gmail.com>
Date: Mon, 12 May 2025 23:28:55 -0400
Subject: factor out shared word mute logic

---
 packages/frontend/src/components/SkMutedNote.vue | 46 ++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 packages/frontend/src/components/SkMutedNote.vue

(limited to 'packages/frontend/src/components/SkMutedNote.vue')

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>
-- 
cgit v1.2.3-freya

