some fixes

This commit is contained in:
Vyacheslav K
2025-04-30 14:27:13 +03:00
parent 2ea5523365
commit 7e131bf638
6 changed files with 102 additions and 42 deletions

View File

@@ -7,7 +7,7 @@ function Message(args) {
return (
<>
{args?.self &&
<div className='flex items-start gap-2 w-full flex-row-reverse'>
<div className='animate-[fadeIn_0.5s_ease-out] flex items-start gap-2 w-full flex-row-reverse'>
<img src={UserIcon} className='h-12' />
<span className='text-white px-4 py-2 text-md rounded-xl bg-gradient-to-br from-orange-400 to-orange-600 break-normal leading-5 shadow-sm'>
@@ -16,9 +16,9 @@ function Message(args) {
</div>
}
{!args?.self &&
<div className='flex items-end gap-2'>
<div className='animate-[fadeIn_0.5s_ease-out] flex items-end gap-2'>
<img src={chatGptIcon} className='h-12' />
<span className='px-4 py-2 text-md rounded-xl bg-gray-200 break-normal w-full leading-5 shadow-sm'>
<span className='px-4 py-2 text-md rounded-xl dark:bg-gray-800 bg-gray-200 break-normal w-full leading-5 shadow-sm'>
{args?.text}
</span>
</div>

6
src/misc/SendForm.js Normal file
View File

@@ -0,0 +1,6 @@
async function SendForm(formData) {
}
export default SendForm;

14
src/misc/Spinner.js Normal file
View File

@@ -0,0 +1,14 @@
function Spinner(args) {
return (
<>
<div className={(args.show ? "flex":"hidden") + " animate-[fadeIn_0.5s_ease-out] absolute inset-0 bg-black/10 backdrop-blur-[3px] flex-col items-center justify-center z-10 rounded-xl"}>
<div className="w-10 h-10 border-4 border-orange-500 border-t-transparent rounded-full animate-spin" style={{ animationDuration: "0.5s" }} ></div>
<span className='block mt-2 text-gray-500 font-bold dark:text-gray-300'>{args?.text}</span>
</div>
</>
);
}
export default Spinner;

25
src/misc/WaitResponse.js Normal file
View File

@@ -0,0 +1,25 @@
function WaitResponse(args) {
return (
<>
<div className={(args.show ? "flex":"hidden")+ ' delay-300 animate-[fadeIn_0.5s_ease-out] items-start gap-2 justify-center px-2'}>
<div className="flex space-x-1 h-full items-center">
<div className="w-2 h-2 bg-gray-400 rounded-full animate-pulse" />
<div
className="w-2 h-2 bg-gray-400 rounded-full animate-pulse"
style={{ animationDelay: "0.1s" }}
/>
<div
className="w-2 h-2 bg-gray-400 rounded-full animate-pulse"
style={{ animationDelay: "0.3s" }}
/>
</div>
<span className='text-gray-400 animate-pulse'>Генерация ответа...</span>
</div>
</>
);
}
export default WaitResponse;