ShareChatModal.svelte 1.31 KB
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
<script lang="ts">
2
	import { getContext } from 'svelte';
Timothy J. Baek's avatar
Timothy J. Baek committed
3
4
	import Modal from '../common/Modal.svelte';

5
6
	const i18n = getContext('i18n');

Timothy J. Baek's avatar
Timothy J. Baek committed
7
8
	export let downloadChat: Function;
	export let shareChat: Function;
9
	export let shareLocalChat: Function;
Timothy J. Baek's avatar
Timothy J. Baek committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23

	export let show = false;
</script>

<Modal bind:show size="xs">
	<div class="px-4 pt-4 pb-5 w-full flex flex-col justify-center">
		<button
			class=" self-center px-8 py-1.5 w-full rounded-full text-sm font-medium bg-blue-600 hover:bg-blue-500 text-white"
			type="button"
			on:click={() => {
				shareChat();
				show = false;
			}}
		>
24
			{$i18n.t('Share to OpenWebUI Community')}
Timothy J. Baek's avatar
Timothy J. Baek committed
25
26
		</button>

27
28
29
30
31
32
33
34
35
36
37
		<button
			class=" self-center px-8 py-1.5 w-full rounded-full text-sm font-medium bg-blue-600 hover:bg-blue-500 text-white mt-1.5"
			type="button"
			on:click={() => {
				shareLocalChat();
				show = false;
			}}
		>
			{$i18n.t('Create local share link')}
		</button>

Timothy J. Baek's avatar
Timothy J. Baek committed
38
		<div class="flex justify-center space-x-1 mt-1.5">
39
			<div class=" self-center text-gray-400 text-xs font-medium">{$i18n.t('or')}</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
40
41

			<button
Timothy J. Baek's avatar
Timothy J. Baek committed
42
				class=" self-center rounded-full text-xs font-medium text-gray-700 dark:text-gray-500 underline"
Timothy J. Baek's avatar
Timothy J. Baek committed
43
44
45
46
47
48
				type="button"
				on:click={() => {
					downloadChat();
					show = false;
				}}
			>
49
				{$i18n.t('Download as a File')}
Timothy J. Baek's avatar
Timothy J. Baek committed
50
51
52
53
			</button>
		</div>
	</div>
</Modal>