{$i18n.t("Prompts")} • {$REXPRO_NAME} {#if loaded} { deleteHandler(deletePrompt); }} >
{$i18n.t("This will delete")} {deletePrompt.command}.
{ console.log(importFiles); if (!importFiles || importFiles.length === 0) return; const reader = new FileReader(); reader.onload = async (event) => { const savedPrompts = JSON.parse(event.target.result); console.log(savedPrompts); try { for (const prompt of savedPrompts) { await createNewPrompt(localStorage.token, { command: prompt.command, name: prompt.name, content: prompt.content, }).catch((error) => { toast.error( typeof error === "string" ? error : JSON.stringify(error), ); return null; }); } page = 1; await getPromptList(); } finally { importFiles = null; promptsImportInputElement.value = ""; } }; reader.readAsText(importFiles[0]); }} />
{$i18n.t("Prompts")}
{total ?? ""}
{#if $user?.role === "admin" || $user?.permissions?.workspace?.prompts_import} {/if} {#if total && ($user?.role === "admin" || $user?.permissions?.workspace?.prompts_export)} {/if}
{#if query}
{/if}
{ if (e.deltaY !== 0) { e.preventDefault(); e.currentTarget.scrollLeft += e.deltaY; } }} >
{ localStorage.workspaceViewOption = value; page = 1; await tick(); }} /> {#if (tags ?? []).length > 0} ({ value: tag, label: tag }))} /> {/if}
{#if prompts === null || loading}
{:else if (prompts ?? []).length !== 0}
{#each prompts as prompt (prompt.id)}
{prompt.name}
/{prompt.command}
{#if !prompt.write_access} {/if}
{$i18n.t("By {{name}}", { name: capitalizeFirstLetter( prompt?.user?.name ?? prompt?.user?.email ?? $i18n.t("Deleted User"), ), })}
·
{#if prompt.content}
{prompt.content}
{/if}
{#if shiftKey} {:else} { shareHandler(prompt); }} cloneHandler={() => { cloneHandler(prompt); }} exportHandler={() => { exportHandler(prompt); }} deleteHandler={async () => { deletePrompt = prompt; showDeleteConfirm = true; }} onClose={() => {}} > {/if}
{/each}
{#if total > 30}
{/if} {:else}
{$i18n.t("No prompts found")}
{$i18n.t( "Try adjusting your search or filter to find what you are looking for.", )}
{/if}
{#if $config?.features.enable_community_sharing}
{$i18n.t("Made by rexpro-ai Community")}
{$i18n.t("Discover a prompt")}
{$i18n.t( "Discover, download, and explore custom prompts", )}
{/if} {:else}
{/if}