mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-22 19:06:12 +00:00
b1f9380c30
Some checks are pending
Update Stable Branch / prepare-release (push) Waiting to run
* Exploration of improving git import * Fix our own git proxy * Clean out file counting for progress, does not seem to work well anyways
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
export const LoadingOverlay = ({
|
|
message = 'Loading...',
|
|
progress,
|
|
progressText,
|
|
}: {
|
|
message?: string;
|
|
progress?: number;
|
|
progressText?: string;
|
|
}) => {
|
|
return (
|
|
<div className="fixed inset-0 flex items-center justify-center bg-black/80 z-50 backdrop-blur-sm">
|
|
<div className="relative flex flex-col items-center gap-4 p-8 rounded-lg bg-bolt-elements-background-depth-2 shadow-lg">
|
|
<div
|
|
className={'i-svg-spinners:90-ring-with-bg text-bolt-elements-loader-progress'}
|
|
style={{ fontSize: '2rem' }}
|
|
></div>
|
|
<p className="text-lg text-bolt-elements-textTertiary">{message}</p>
|
|
{progress !== undefined && (
|
|
<div className="w-64 flex flex-col gap-2">
|
|
<div className="w-full h-2 bg-bolt-elements-background-depth-1 rounded-full overflow-hidden">
|
|
<div
|
|
className="h-full bg-bolt-elements-loader-progress transition-all duration-300 ease-out rounded-full"
|
|
style={{ width: `${Math.min(100, Math.max(0, progress))}%` }}
|
|
/>
|
|
</div>
|
|
{progressText && <p className="text-sm text-bolt-elements-textTertiary text-center">{progressText}</p>}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|