2023-01-02 15:22:33 -05:00
|
|
|
<script lang="ts">
|
2024-02-14 06:38:57 -08:00
|
|
|
import { copyToClipboard } from '$lib/utils';
|
|
|
|
|
import { mdiKeyVariant } from '@mdi/js';
|
2023-07-01 00:50:47 -04:00
|
|
|
import Button from '../elements/buttons/button.svelte';
|
2023-08-25 19:44:52 +02:00
|
|
|
import FullScreenModal from '../shared-components/full-screen-modal.svelte';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
secret?: string;
|
|
|
|
|
onDone: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { secret = '', onDone }: Props = $props();
|
2023-01-02 15:22:33 -05:00
|
|
|
</script>
|
|
|
|
|
|
2024-09-20 23:02:58 +02:00
|
|
|
<FullScreenModal title={$t('api_key')} icon={mdiKeyVariant} onClose={onDone}>
|
2024-04-08 21:02:09 +00:00
|
|
|
<div class="text-immich-primary dark:text-immich-dark-primary">
|
|
|
|
|
<p class="text-sm dark:text-immich-dark-fg">
|
2024-06-24 15:50:01 +02:00
|
|
|
{$t('api_key_description')}
|
2024-04-08 21:02:09 +00:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2024-04-08 21:02:09 +00:00
|
|
|
<div class="my-4 flex flex-col gap-2">
|
2024-06-04 21:53:00 +02:00
|
|
|
<!-- <label class="immich-form-label" for="secret">{ $t("api_key") }</label> -->
|
2024-11-02 16:49:07 +01:00
|
|
|
<textarea class="immich-form-input" id="secret" name="secret" readonly={true} value={secret}></textarea>
|
2024-04-08 21:02:09 +00:00
|
|
|
</div>
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
{#snippet stickyBottom()}
|
|
|
|
|
<Button onclick={() => copyToClipboard(secret)} fullwidth>{$t('copy_to_clipboard')}</Button>
|
|
|
|
|
<Button onclick={onDone} fullwidth>{$t('done')}</Button>
|
|
|
|
|
{/snippet}
|
2023-01-02 15:22:33 -05:00
|
|
|
</FullScreenModal>
|