feat: clear prompt library

Fixes #266
This commit is contained in:
Jing Hua 2023-05-01 21:51:27 +08:00
parent bd0f91f1a2
commit 3fff7968a3
14 changed files with 25 additions and 0 deletions

View file

@ -34,6 +34,7 @@
"resetCost": "Nulstil Omkostninger",
"countTotalTokens": "Tæl totale tokens",
"morePrompts": "Du kan finde flere opgaver her: ",
"clearPrompts": "Ryd prompter",
"postOnShareGPT": {
"title": "Indlæg på ShareGPT",
"warning": "Vær opmærksom på, at ved at poste din samtale på ShareGPT, vil den blive offentligt tilgængelig og synlig for alle. Når den er postet, kan samtalen ikke skjules eller slettes og kan blive arkiveret eller delt af andre. Vi råder dig til at overveje nøje og undgå at dele følsomme eller private oplysninger på denne platform."

View file

@ -34,6 +34,7 @@
"resetCost": "Reset Costs",
"countTotalTokens": "Count total tokens",
"morePrompts": "You can find more prompts here: ",
"clearPrompts": "Clear prompts",
"postOnShareGPT": {
"title": "Post on ShareGPT",
"warning": "Please be aware that by posting your conversation on ShareGPT, it will become publicly accessible and viewable to anyone. Once posted, the conversation cannot be hidden or deleted, and may be archived or shared by others. We advise you to consider carefully and avoid sharing sensitive or private information on this platform."

View file

@ -34,6 +34,7 @@
"resetCost": "Reset Costs",
"countTotalTokens": "Count total tokens",
"morePrompts": "You can find more prompts here: ",
"clearPrompts": "Clear prompts",
"postOnShareGPT": {
"title": "Post on ShareGPT",
"warning": "Please be aware that by posting your conversation on ShareGPT, it will become publicly accessible and viewable to anyone. Once posted, the conversation cannot be hidden or deleted, and may be archived or shared by others. We advise you to consider carefully and avoid sharing sensitive or private information on this platform."

View file

@ -34,6 +34,7 @@
"resetCost": "Reiniciar costos",
"countTotalTokens": "Contar tokens totales",
"morePrompts": "Puedes encontrar más prompts aquí: ",
"clearPrompts": "Prompts claras",
"postOnShareGPT": {
"title": "Publicar en ShareGPT",
"warning": "Por favor, tenga en cuenta que al publicar su conversación en ShareGPT, esta será accesible y visible para cualquiera. Una vez publicada, la conversación no se podrá ocultar ni eliminar, y puede ser archivada o compartida por otros. Le aconsejamos que lo considere detenidamente y evite compartir información sensible o privada en esta plataforma."

View file

@ -34,6 +34,7 @@
"resetCost": "Réinitialiser les coûts",
"countTotalTokens": "Compter le nombre total de jetons",
"morePrompts": "Vous pouvez trouver plus de prompts ici : ",
"clearPrompts": "Effacer les prompts",
"postOnShareGPT": {
"title": "Publier sur ShareGPT",
"warning": "Veuillez noter que si vous publiez votre conversation sur ShareGPT, elle deviendra accessible au public et visible par tous. Une fois publiée, la conversation ne peut pas être cachée ou supprimée, et peut être archivée ou partagée par d'autres. Nous vous conseillons de considérer attentivement et d'éviter de partager des informations sensibles ou privées sur cette plateforme."

View file

@ -34,6 +34,7 @@
"resetCost": "Ripristina costi",
"countTotalTokens": "Conteggio totale dei token",
"morePrompts": "Puoi trovare altri prompt qui:",
"clearPrompts": "Cancella prompts",
"postOnShareGPT": {
"title": "Pubblica su ShareGPT",
"warning": "Ti ricordiamo che pubblicando la tua conversazione su ShareGPT, questa diventerà pubblicamente accessibile e visualizzabile da chiunque. Una volta pubblicata, la conversazione non può essere nascosta o cancellata e può essere archiviata o condivisa da altri. Ti consigliamo di valutare attentamente e di evitare di condividere informazioni sensibili o private su questa piattaforma."

View file

@ -34,6 +34,7 @@
"resetCost": "コストをリセットする",
"countTotalTokens": "トークンの合計数をカウント",
"morePrompts": "ここでさらにプロンプトを見つけることができます:",
"clearPrompts": "プロンプトをクリア",
"postOnShareGPT": {
"title": "ShareGPTに投稿",
"warning": "ShareGPTに会話を投稿すると、誰でもアクセスして閲覧できるようになることに注意してください。一度投稿すると、会話は非表示にできず、削除もできません。また、他の人がアーカイブや共有する可能性があります。このプラットフォームで機密性のある情報や個人情報を共有しないように注意してください。"

View file

@ -34,6 +34,7 @@
"resetCost": "Reset Kos",
"countTotalTokens": "Kira jumlah token keseluruhan",
"morePrompts": "Anda boleh mencari lebih banyak arahan di sini: ",
"clearPrompts": "Kosongkan arahan",
"postOnShareGPT": {
"title": "Siarkan di ShareGPT",
"warning": "Sila ambil perhatian bahawa dengan menyiarkan perbualan anda di ShareGPT, ia akan menjadi boleh diakses dan dilihat oleh sesiapa sahaja. Setelah disiarkan, perbualan tidak boleh disembunyikan atau dipadam, dan mungkin diarkibkan atau dikongsi oleh orang lain. Kami menasihatkan anda untuk mempertimbangkan dengan teliti dan mengelakkan berkongsi maklumat sensitif atau peribadi di platform ini."

View file

@ -34,6 +34,7 @@
"resetCost": "Tilbakestill kostnader",
"countTotalTokens": "Tell totale token",
"morePrompts": "Du kan finne flere oppgaver her: ",
"clearPrompts": "Tøm oppgave",
"postOnShareGPT": {
"title": "Innlegg på ShareGPT",
"warning": "Vær oppmerksom på at ved å poste samtalen din på ShareGPT, vil den bli offentlig tilgjengelig og synlig for alle. Når den er postet, kan samtalen ikke skjules eller slettes, og den kan bli arkivert eller delt av andre. Vi anbefaler deg å tenke nøye gjennom og unngå å dele sensitiv eller privat informasjon på denne plattformen."

View file

@ -34,6 +34,7 @@
"resetCost": "Återställ kostnader",
"countTotalTokens": "Räkna totala token",
"morePrompts": "Du kan hitta fler uppmaningar här: ",
"clearPrompts": "Rensa uppmaningar",
"postOnShareGPT": {
"title": "Inlägg på ShareGPT",
"warning": "Var medveten om att genom att posta din konversation på ShareGPT kommer den att bli offentligt tillgänglig och synlig för alla. När den väl är postad kan konversationen varken döljas eller raderas och kan arkiveras eller delas av andra. Vi rekommenderar dig att tänka noggrant igenom och undvika att dela känslig eller privat information på denna plattform."

View file

@ -34,6 +34,7 @@
"resetCost": "重置费用",
"countTotalTokens": "计算总 Token 数",
"morePrompts": "更多提示词请点击:",
"clearPrompts": "清除提示词",
"postOnShareGPT": {
"title": "发布至 ShareGPT",
"warning": "请注意,把您的对话发布到 ShareGPT 后,任何人都可以公开访问和查看。发布后,对话不能被隐藏或删除,且可能被其他人存档或分享。建议您慎重考虑,在这个平台上避免分享敏感或私密信息。"

View file

@ -34,6 +34,7 @@
"resetCost": "重置費用",
"countTotalTokens": "計算總 Token 數",
"morePrompts": "如果你想揾更多 prompt撳呢度",
"clearPrompts": "清空 prompts",
"postOnShareGPT": {
"title": "po 上 ShareGPT",
"warning": "請注意,你將呢個傾偈 po 上 ShareGPT 之後,佢會係公開嘅,所有人都可以見到你寫嘅嘢。一旦 po 咗,呢個傾偈將冇得被隱藏或刪除,亦都可能畀人存檔同分享。我哋建議你仔細諗下,唔好喺嗰度分享敏感或私人資料。"

View file

@ -34,6 +34,7 @@
"resetCost": "重置費用",
"countTotalTokens": "計算總 Token 數",
"morePrompts": "更多提示詞請點選:",
"clearPrompts": "清除提示詞",
"postOnShareGPT": {
"title": "發佈至 ShareGPT",
"warning": "請注意,將您的對話發佈至 ShareGPT 後,任何人都可以公開訪問和查看。一旦發佈,對話將無法隱藏或刪除,並且可能被他人存檔或分享。我們建議您慎重考慮,並避免在此平台上分享敏感或私人信息。"

View file

@ -67,6 +67,10 @@ const PromptLibraryMenuPopUp = ({
_setPrompts(updatedPrompts);
};
const clearPrompts = () => {
_setPrompts([]);
};
const handleOnFocus = (e: React.FocusEvent<HTMLTextAreaElement, Element>) => {
e.target.style.height = 'auto';
e.target.style.height = `${e.target.scrollHeight}px`;
@ -149,6 +153,14 @@ const PromptLibraryMenuPopUp = ({
<div className='flex justify-center cursor-pointer' onClick={addPrompt}>
<PlusIcon />
</div>
<div className='flex justify-center mt-2'>
<div
className='btn btn-neutral cursor-pointer text-xs'
onClick={clearPrompts}
>
{t('clearPrompts')}
</div>
</div>
<div className='mt-6 px-2'>
{t('morePrompts')}
<a