[feat] add template warn

This commit is contained in:
kwaroran
2023-08-09 01:38:47 +09:00
parent f80f1f9e9e
commit f61da89db2
2 changed files with 91 additions and 0 deletions

View File

@@ -3,12 +3,15 @@
import { language } from "src/lang";
import ProomptItem from "src/lib/UI/ProomptItem.svelte";
import type { Proompt } from "src/ts/process/proompt";
import { templateCheck } from "src/ts/process/templates/templateCheck";
import { DataBase } from "src/ts/storage/database";
let sorted = 0
let opened = 0
let warns: string[] = []
export let onGoBack: () => void = () => {}
$: warns = templateCheck($DataBase)
</script>
<h2 class="mb-2 text-2xl font-bold mt-2 items-center flex">
@@ -17,6 +20,15 @@
</button>
{language.promptTemplate}
</h2>
{#if warns.length > 0}
<div class="text-red-500 flex flex-col items-start p-2 rounded-md border-red-500 border">
<h2 class="text-xl font-bold">Warning</h2>
<div class="border-b border-b-red-500 mt-1 mb-2 w-full"></div>
{#each warns as warn}
<span class="ml-4">{warn}</span>
{/each}
</div>
{/if}
<div class="contain w-full max-w-full mt-4 flex flex-col p-3 rounded-md">
{#if $DataBase.promptTemplate.length === 0}
<div class="text-textcolor2">No Format</div>