Add foundational components and logic for migration, UI design, and input handling
- Introduced foundational UI components (`Badge`, `LockCard`, `SectionHeader`, `AvatarIcon`, etc.) for flexible layouts and consistent design. - Added migration support with the `MigrationModal` component and backend integration for exporting/importing data between Electron and Tauri. - Extended form components with `TextAreaInput`, `OrderInput`, `ToggleField`, and `ToolbarSelect` for improved input handling. - Updated `ScribeShell` with migration popup logic to prompt users for data migration. - Integrated `AlertStack` for better alert handling and notification management. - Enhanced Rust/Tauri services with migration command implementations. - Added translations and styles for new components.
This commit is contained in:
30
components/ui/PulseLoader.tsx
Normal file
30
components/ui/PulseLoader.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
import {Loader2} from 'lucide-react';
|
||||
|
||||
type PulseLoaderSize = 'sm' | 'md' | 'lg';
|
||||
|
||||
interface PulseLoaderProps {
|
||||
text?: string;
|
||||
size?: PulseLoaderSize;
|
||||
}
|
||||
|
||||
const sizeClasses: Record<PulseLoaderSize, { container: string; icon: string }> = {
|
||||
sm: {container: 'py-8', icon: 'w-6 h-6'},
|
||||
md: {container: 'h-32', icon: 'w-8 h-8'},
|
||||
lg: {container: 'h-64', icon: 'w-10 h-10'},
|
||||
};
|
||||
|
||||
export default function PulseLoader({text, size = 'md'}: PulseLoaderProps): React.JSX.Element {
|
||||
const sizeConfig: { container: string; icon: string } = sizeClasses[size];
|
||||
|
||||
return (
|
||||
<div className={`flex items-center justify-center ${sizeConfig.container}`}>
|
||||
<div className="flex flex-col items-center">
|
||||
<Loader2 className={`${sizeConfig.icon} text-primary animate-spin mb-3`} strokeWidth={1.75}/>
|
||||
{text && (
|
||||
<p className="text-text-secondary">{text}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user