My Prompts
{#if $prompts.length === 0}
{:else} {#each $prompts.filter((p) => query === '' || p.command.includes(query)) as prompt}
{/each} {/if}
{ console.log(importFiles); const reader = new FileReader(); reader.onload = async (event) => { const savedPrompts = JSON.parse(event.target.result); console.log(savedPrompts); for (const prompt of savedPrompts) { await createNewPrompt( localStorage.token, prompt.command.charAt(0) === '/' ? prompt.command.slice(1) : prompt.command, prompt.title, prompt.content ).catch((error) => { toast.error(error); return null; }); } await prompts.set(await getPrompts(localStorage.token)); }; reader.readAsText(importFiles[0]); }} />