2025-05-23 18:03:35 -06:00
|
|
|
interface MessageBoxLoadingProps {
|
|
|
|
|
progress: {
|
|
|
|
|
message: string;
|
|
|
|
|
current: number;
|
|
|
|
|
total: number;
|
2025-05-25 14:51:21 -06:00
|
|
|
subMessage?: string;
|
2025-05-23 18:03:35 -06:00
|
|
|
} | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MessageBoxLoading = ({ progress }: MessageBoxLoadingProps) => {
|
2024-04-09 16:21:05 +05:30
|
|
|
return (
|
2025-05-23 18:03:35 -06:00
|
|
|
<div className="flex flex-col space-y-4 w-full lg:w-9/12">
|
|
|
|
|
{progress && progress.current !== progress.total ? (
|
|
|
|
|
<div className="bg-light-primary dark:bg-dark-primary rounded-lg p-4">
|
|
|
|
|
<div className="flex flex-col space-y-3">
|
2025-05-25 14:51:21 -06:00
|
|
|
<p className="text-base font-semibold text-black dark:text-white">
|
2025-05-23 18:03:35 -06:00
|
|
|
{progress.message}
|
|
|
|
|
</p>
|
2025-05-25 14:51:21 -06:00
|
|
|
{progress.subMessage && (
|
|
|
|
|
<p
|
|
|
|
|
className="text-xs text-black/40 dark:text-white/40 mt-1"
|
|
|
|
|
title={progress.subMessage}
|
|
|
|
|
>
|
|
|
|
|
{progress.subMessage}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2025-05-23 18:03:35 -06:00
|
|
|
<div className="w-full bg-light-secondary dark:bg-dark-secondary rounded-full h-2 overflow-hidden">
|
|
|
|
|
<div
|
2025-05-25 14:51:21 -06:00
|
|
|
className={`h-full bg-[#24A0ED] transition-all duration-300 ease-in-out ${
|
|
|
|
|
progress.current === progress.total ? '' : 'animate-pulse'
|
|
|
|
|
}`}
|
2025-05-23 18:03:35 -06:00
|
|
|
style={{
|
|
|
|
|
width: `${(progress.current / progress.total) * 100}%`,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="bg-light-primary dark:bg-dark-primary animate-pulse rounded-lg py-3">
|
|
|
|
|
<div className="h-2 rounded-full w-full bg-light-secondary dark:bg-dark-secondary" />
|
|
|
|
|
<div className="h-2 mt-2 rounded-full w-9/12 bg-light-secondary dark:bg-dark-secondary" />
|
|
|
|
|
<div className="h-2 mt-2 rounded-full w-10/12 bg-light-secondary dark:bg-dark-secondary" />
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2024-04-09 16:21:05 +05:30
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default MessageBoxLoading;
|