From 8b5768f8482573a4b1d709214dc762f7e9a7de97 Mon Sep 17 00:00:00 2001
From: Hazelnoot <acomputerdog@gmail.com>
Date: Tue, 1 Apr 2025 12:49:53 -0400
Subject: add DynamicNoteSimple.vue

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

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

diff --git a/packages/frontend/src/components/DynamicNoteSimple.vue b/packages/frontend/src/components/DynamicNoteSimple.vue
new file mode 100644
index 0000000000..a7713afad1
--- /dev/null
+++ b/packages/frontend/src/components/DynamicNoteSimple.vue
@@ -0,0 +1,48 @@
+<!--
+SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
+SPDX-License-Identifier: AGPL-3.0-only
+-->
+
+<template>
+<XNoteSimple
+	ref="rootEl"
+	:note="note"
+	:expandAllCws="expandAllCws"
+	:hideFiles="hideFiles"
+	@editScheduledNote="() => emit('editScheduleNote')"
+/>
+</template>
+
+<script setup lang="ts">
+import * as Misskey from 'misskey-js';
+import { computed, defineAsyncComponent, shallowRef } from 'vue';
+import type { ComponentExposed } from 'vue-component-type-helpers';
+import type MkNoteSimple from '@/components/MkNoteSimple.vue';
+import type SkNoteSimple from '@/components/SkNoteSimple.vue';
+import { prefer } from '@/preferences';
+
+const XNoteSimple = computed(() =>
+	defineAsyncComponent<typeof MkNoteSimple | typeof SkNoteSimple>(() =>
+		prefer.r.noteDesign.value === 'misskey'
+			? import('@/components/MkNoteSimple.vue')
+			: import('@/components/SkNoteSimple.vue'),
+	),
+);
+
+const rootEl = shallowRef<ComponentExposed<typeof MkNoteSimple | typeof SkNoteSimple>>();
+
+defineExpose({ rootEl });
+
+defineProps<{
+	note: Misskey.entities.Note & {
+		isSchedule?: boolean,
+		scheduledNoteId?: string
+	};
+	expandAllCws?: boolean;
+	hideFiles?: boolean;
+}>();
+
+const emit = defineEmits<{
+	(ev: 'editScheduleNote'): void;
+}>();
+</script>
-- 
cgit v1.2.3-freya

