File size: 1,944 Bytes
82fcab7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3c1540
82fcab7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script lang="ts">
	import { createEventDispatcher } from "svelte";

	import Modal from "$lib/components/Modal.svelte";
	import CarbonClose from "~icons/carbon/close";
	import Switch from "$lib/components/Switch.svelte";
	import type { Settings } from "$lib/types/Settings";
	import { updateSettings } from "$lib/updateSettings";

	export let settings: Pick<Settings, "shareConversationsWithModelAuthors">;

	const dispatch = createEventDispatcher<{ close: void }>();
</script>

<Modal>
	<div class="flex w-full flex-col gap-5 p-6">
		<div class="flex items-start justify-between text-xl font-semibold text-gray-800">
			<h2>Settings</h2>
			<button class="group" on:click={() => dispatch("close")}>
				<CarbonClose class="text-gray-900 group-hover:text-gray-500" />
			</button>
		</div>

		<label class="flex cursor-pointer select-none items-center gap-2 text-gray-500" for="switch">
			<Switch name="switch" bind:checked={settings.shareConversationsWithModelAuthors} />
			Share conversations with model authors
		</label>

		<p class="text-gray-800">
			Sharing your data will help improve the training data and make open models better over time.
		</p>
		<p class="text-gray-800">
			You can change this setting at any time, it applies to all your conversations.
		</p>
		<p class="text-gray-800">
			Read more about this model's authors,
			<a
				href="https://open-assistant.io/"
				target="_blank"
				rel="noreferrer"
				class="underline decoration-gray-300 hover:decoration-gray-700">Open Assistant</a
			>.
		</p>
		<button
			type="button"
			class="mt-2 rounded-full bg-black px-5 py-2 text-lg font-semibold text-gray-100 ring-gray-400 ring-offset-1 transition-colors hover:ring"
			on:click={() =>
				updateSettings({
					shareConversationsWithModelAuthors: settings.shareConversationsWithModelAuthors,
				}).then((res) => {
					if (res) {
						dispatch("close");
					}
				})}
		>
			Apply
		</button>
	</div>
</Modal>