161 | {body} 162 |
163 | ) 164 | }) 165 | FormMessage.displayName = "FormMessage" 166 | 167 | export { 168 | useFormField, 169 | Form, 170 | FormItem, 171 | FormLabel, 172 | FormControl, 173 | FormDescription, 174 | FormMessage, 175 | FormField, 176 | } 177 | -------------------------------------------------------------------------------- /src/artifacts/index.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { AlertCircle, Mail, Lock, Github, Facebook, Twitter } from 'lucide-react'; 3 | import { Alert, AlertDescription } from '@/components/ui/alert'; 4 | import { Button } from '@/components/ui/button'; 5 | import { Input } from '@/components/ui/input'; 6 | import { Label } from '@/components/ui/label'; 7 | import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; 8 | import { Link } from "react-router-dom"; 9 | 10 | const LoginForm = () => { 11 | const [email, setEmail] = useState(''); 12 | const [password, setPassword] = useState(''); 13 | const [error, setError] = useState(''); 14 | 15 | const handleLogin = (e: React.FormEvent) => { 16 | e.preventDefault(); 17 | if (!email || !password) { 18 | setError('Please fill in all fields'); 19 | } else { 20 | setError(''); 21 | console.log('Login attempted:', { email, password }); 22 | // Here you would typically handle the login logic 23 | alert(`Login attempted: ${email}, ${password}`); 24 | } 25 | }; 26 | 27 | const handleSocialLogin = (platform: string) => { 28 | console.log(`${platform} login attempted`); 29 | // Here you would typically handle the social login logic 30 | alert(`${platform} login attempted`); 31 | }; 32 | 33 | return ( 34 |