From bce557cc2dc767628bed6aac87301a1be7c5431b Mon Sep 17 00:00:00 2001
From: rxliuli <rxliuli@gmail.com>
Date: Tue, 4 Nov 2025 05:03:50 +0800
Subject: init commit

---
 src/components/jet/item/ContentModal.svelte | 39 +++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 src/components/jet/item/ContentModal.svelte

(limited to 'src/components/jet/item/ContentModal.svelte')

diff --git a/src/components/jet/item/ContentModal.svelte b/src/components/jet/item/ContentModal.svelte
new file mode 100644
index 0000000..486937d
--- /dev/null
+++ b/src/components/jet/item/ContentModal.svelte
@@ -0,0 +1,39 @@
+<script lang="ts">
+    import ContentModal from '@amp/web-app-components/src/components/Modal/ContentModal.svelte';
+    import { getI18n } from '~/stores/i18n';
+    import { createEventDispatcher } from 'svelte';
+    import { getJet } from '~/jet';
+
+    export let title: string | null;
+    export let subtitle: string | null;
+    export let text: string | null = null;
+    export let dialogTitleId: string | null = null;
+    export let targetId: string = 'close';
+
+    const i18n = getI18n();
+    const jet = getJet();
+    const dispatch = createEventDispatcher();
+
+    const translateFn = (key: string) => $i18n.t(key);
+
+    const handleCloseModal = () => {
+        dispatch('close');
+        jet.recordCustomMetricsEvent({
+            eventType: 'click',
+            targetId,
+            targetType: 'button',
+            actionType: 'close',
+        });
+    };
+</script>
+
+<ContentModal
+    on:close={handleCloseModal}
+    {translateFn}
+    {title}
+    {subtitle}
+    text={text || undefined}
+    {dialogTitleId}
+>
+    <slot name="content" slot="content" />
+</ContentModal>
-- 
cgit v1.2.3

