blob: 486937de40f139e9c41567dfb8335c6195eba6ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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>
|