mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:43:59 +01:00
parent
6ef5a6b09e
commit
fd14260c84
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Ny mappe"
|
||||
"newFolder": "Ny mappe",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "New Folder"
|
||||
"newFolder": "New Folder",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Nueva Carpeta"
|
||||
"newFolder": "Nueva Carpeta",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Nouveau Dossier"
|
||||
"newFolder": "Nouveau Dossier",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"title": "ShareGPTに投稿",
|
||||
"warning": "ShareGPTに会話を投稿すると、誰でもアクセスして閲覧できるようになることに注意してください。一度投稿すると、会話は非表示にできず、削除もできません。また、他の人がアーカイブや共有する可能性があります。このプラットフォームで機密性のある情報や個人情報を共有しないように注意してください。"
|
||||
},
|
||||
"newFolder": "新しいフォルダー"
|
||||
"newFolder": "新しいフォルダー",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Folder Baru"
|
||||
"newFolder": "Folder Baru",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Ny mappe"
|
||||
"newFolder": "Ny mappe",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"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."
|
||||
},
|
||||
"newFolder": "Ny mapp"
|
||||
"newFolder": "Ny mapp",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"title": "发布至 ShareGPT",
|
||||
"warning": "请注意,把您的对话发布到 ShareGPT 后,任何人都可以公开访问和查看。发布后,对话不能被隐藏或删除,且可能被其他人存档或分享。建议您慎重考虑,在这个平台上避免分享敏感或私密信息。"
|
||||
},
|
||||
"newFolder": "新文件夹"
|
||||
"newFolder": "新文件夹",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"title": "po 上 ShareGPT",
|
||||
"warning": "請注意,你將呢個傾偈 po 上 ShareGPT 之後,佢會係公開嘅,所有人都可以見到你寫嘅嘢。一旦 po 咗,呢個傾偈將冇得被隱藏或刪除,亦都可能畀人存檔同分享。我哋建議你諗清楚,唔好喺嗰度分享敏感或私人資料。"
|
||||
},
|
||||
"newFolder": "新資料夾"
|
||||
"newFolder": "新資料夾",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
|
@ -33,5 +33,7 @@
|
|||
"title": "發佈至 ShareGPT",
|
||||
"warning": "請注意,將您的對話發佈至 ShareGPT 後,任何人都可以公開訪問和查看。一旦發佈,對話將無法隱藏或刪除,並且可能被他人存檔或分享。我們建議您慎重考慮,並避免在此平台上分享敏感或私人信息。"
|
||||
},
|
||||
"newFolder": "新資料夾"
|
||||
"newFolder": "新資料夾",
|
||||
"cloneChat": "Clone Chat",
|
||||
"cloned": "Cloned"
|
||||
}
|
||||
|
|
17
src/assets/icons/CloneIcon.tsx
Normal file
17
src/assets/icons/CloneIcon.tsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
import React from 'react';
|
||||
|
||||
const CloneIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
||||
return (
|
||||
<svg
|
||||
viewBox='0 0 512 512'
|
||||
fill='currentColor'
|
||||
height='1em'
|
||||
width='1em'
|
||||
{...props}
|
||||
>
|
||||
<path d='M64 464h224c8.8 0 16-7.2 16-16v-64h48v64c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V224c0-35.3 28.65-64 64-64h64v48H64c-8.84 0-16 7.2-16 16v224c0 8.8 7.16 16 16 16zm96-400c0-35.35 28.7-64 64-64h224c35.3 0 64 28.65 64 64v224c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64V64zm64 240h224c8.8 0 16-7.2 16-16V64c0-8.84-7.2-16-16-16H224c-8.8 0-16 7.16-16 16v224c0 8.8 7.2 16 16 16z' />
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
|
||||
export default CloneIcon;
|
|
@ -10,6 +10,7 @@ import CrossIcon from '@icon/CrossIcon';
|
|||
|
||||
import useSubmit from '@hooks/useSubmit';
|
||||
import DownloadChat from './DownloadChat';
|
||||
import CloneChat from './CloneChat';
|
||||
import ShareGPT from '@components/ShareGPT';
|
||||
|
||||
const ChatContent = () => {
|
||||
|
@ -91,11 +92,12 @@ const ChatContent = () => {
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className='mt-4 flex gap-4'>
|
||||
<div className='mt-4 flex gap-4 flex-wrap justify-center'>
|
||||
{useStore.getState().generating || (
|
||||
<>
|
||||
<DownloadChat saveRef={saveRef} />
|
||||
<ShareGPT />
|
||||
<CloneChat />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
59
src/components/Chat/ChatContent/CloneChat.tsx
Normal file
59
src/components/Chat/ChatContent/CloneChat.tsx
Normal file
|
@ -0,0 +1,59 @@
|
|||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import useStore from '@store/store';
|
||||
|
||||
import { ChatInterface } from '@type/chat';
|
||||
|
||||
import TickIcon from '@icon/TickIcon';
|
||||
|
||||
const CloneChat = React.memo(() => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const setChats = useStore((state) => state.setChats);
|
||||
const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex);
|
||||
|
||||
const [cloned, setCloned] = useState<boolean>(false);
|
||||
|
||||
const cloneChat = () => {
|
||||
const chats = useStore.getState().chats;
|
||||
|
||||
if (chats) {
|
||||
const index = useStore.getState().currentChatIndex;
|
||||
let title = `Copy of ${chats[index].title}`;
|
||||
let i = 0;
|
||||
|
||||
while (chats.some((chat) => chat.title === title)) {
|
||||
i += 1;
|
||||
title = `Copy ${i} of ${chats[index].title}`;
|
||||
}
|
||||
|
||||
const clonedChat = JSON.parse(JSON.stringify(chats[index]));
|
||||
clonedChat.title = title;
|
||||
|
||||
const updatedChats: ChatInterface[] = JSON.parse(JSON.stringify(chats));
|
||||
updatedChats.unshift(clonedChat);
|
||||
|
||||
setChats(updatedChats);
|
||||
setCurrentChatIndex(useStore.getState().currentChatIndex + 1);
|
||||
setCloned(true);
|
||||
|
||||
window.setTimeout(() => {
|
||||
setCloned(false);
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<button className='btn btn-neutral flex gap-1' onClick={cloneChat}>
|
||||
{cloned ? (
|
||||
<>
|
||||
<TickIcon /> {t('cloned')}
|
||||
</>
|
||||
) : (
|
||||
<>{t('cloneChat')}</>
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
|
||||
export default CloneChat;
|
Loading…
Reference in a new issue