Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ import {
HelpCircle,
ThumbsUp,
ThumbsDown,
Download
Download,
Loader2
} from 'lucide-react';

export const Spinner = ({ className = "w-6 h-6" }) => (
<Loader2 className={`animate-spin ${className}`} />
);

export const ChatIcon = ({ className = "w-6 h-6" }) => <MessageSquare className={className} />;
export const MicIcon = ({ className = "w-6 h-6" }) => <Mic className={className} />;
export const DocIcon = ({ className = "w-6 h-6" }) => <FileText className={className} />;
Expand Down
8 changes: 6 additions & 2 deletions components/LoginView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import React, { useState } from 'react';
import { User } from '../types';
import { Spinner } from './Icons';

interface LoginViewProps {
onLogin: (email: string) => void;
Expand All @@ -9,6 +10,7 @@ interface LoginViewProps {

const LoginView: React.FC<LoginViewProps> = ({ onLogin, error: externalError }) => {
const [email, setEmail] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(externalError || '');

const handleSubmit = (e: React.FormEvent) => {
Expand All @@ -17,6 +19,7 @@ const LoginView: React.FC<LoginViewProps> = ({ onLogin, error: externalError })
setError('Bitte gib deine Wohnpro E-Mail Adresse ein.');
return;
}
setIsLoading(true);
onLogin(email);
};

Expand Down Expand Up @@ -48,9 +51,10 @@ const LoginView: React.FC<LoginViewProps> = ({ onLogin, error: externalError })

<button
type="submit"
className="w-full bg-black text-white rounded-2xl py-4 font-semibold text-lg hover:bg-gray-900 active:scale-[0.98] transition-all shadow-lg shadow-black/5"
disabled={isLoading}
className="w-full bg-black text-white rounded-2xl py-4 font-semibold text-lg hover:bg-gray-900 active:scale-[0.98] transition-all shadow-lg shadow-black/5 flex items-center justify-center disabled:opacity-50"
>
Guide öffnen
{isLoading ? <Spinner className="w-7 h-7" /> : 'Guide öffnen'}
</button>
</form>

Expand Down
Loading