{#if importing} { try { if (importText == '') { throw new Error('import failed') } themeData.current.colors = JSON.parse(importText) toast({ content: $t('message.success'), type: 'success' }) importing = false } catch (err) { toast({ content: err as string, type: 'error' }) } }} title={$t('settings.import')} action={$t('settings.import')} > {/if} {$t('routes.theme.title')} {#snippet extended()} { importing = !importing }} rounding="pill" disabled={themeData.current.id <= 0} > {$t('settings.import')} { navigator.clipboard.writeText(JSON.stringify(themeData.current.colors)) toast({ content: 'Copied theme to clipboard.' }) }} rounding="pill" > {$t('settings.export')} { modal({ actions: [ action({ content: $t('common.cancel'), close: true, }), action({ action: () => { themeData.current.colors = { other: {}, primary: {}, zinc: {}, slate: {}, } }, content: $t('settings.reset'), close: true, type: 'danger', }), ], title: $t('routes.theme.resetWarning.title'), body: $t('routes.theme.resetWarning.description'), }) }} rounding="pill" > {$t('settings.reset')} {/snippet}