khankashif commited on
Commit
5ac4869
·
verified ·
1 Parent(s): de7be63

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +94 -0
app.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useState } from "react";
2
+ import { Card, CardContent } from "@/components/ui/card";
3
+ import { Button } from "@/components/ui/button";
4
+ import { Input } from "@/components/ui/input";
5
+ import { Label } from "@/components/ui/label";
6
+
7
+ const HuggingFaceIntroApp = () => {
8
+ const [formData, setFormData] = useState({
9
+ name: "",
10
+ education: "",
11
+ caste: "",
12
+ email: "",
13
+ });
14
+
15
+ const handleChange = (e) => {
16
+ const { name, value } = e.target;
17
+ setFormData({
18
+ ...formData,
19
+ [name]: value,
20
+ });
21
+ };
22
+
23
+ const handleSubmit = (e) => {
24
+ e.preventDefault();
25
+ console.log("Form Data Submitted:", formData);
26
+ alert("Form submitted successfully!");
27
+ // Add any additional logic here, like API calls.
28
+ };
29
+
30
+ return (
31
+ <div className="min-h-screen flex items-center justify-center bg-gray-100">
32
+ <Card className="w-full max-w-md shadow-lg p-4">
33
+ <CardContent>
34
+ <h1 className="text-xl font-bold text-center mb-4">Hugging Face Introduction</h1>
35
+ <form onSubmit={handleSubmit} className="space-y-4">
36
+ <div>
37
+ <Label htmlFor="name">Name</Label>
38
+ <Input
39
+ type="text"
40
+ id="name"
41
+ name="name"
42
+ value={formData.name}
43
+ onChange={handleChange}
44
+ placeholder="Enter your name"
45
+ required
46
+ />
47
+ </div>
48
+ <div>
49
+ <Label htmlFor="education">Education</Label>
50
+ <Input
51
+ type="text"
52
+ id="education"
53
+ name="education"
54
+ value={formData.education}
55
+ onChange={handleChange}
56
+ placeholder="Enter your education"
57
+ required
58
+ />
59
+ </div>
60
+ <div>
61
+ <Label htmlFor="caste">Caste</Label>
62
+ <Input
63
+ type="text"
64
+ id="caste"
65
+ name="caste"
66
+ value={formData.caste}
67
+ onChange={handleChange}
68
+ placeholder="Enter your caste"
69
+ required
70
+ />
71
+ </div>
72
+ <div>
73
+ <Label htmlFor="email">Email</Label>
74
+ <Input
75
+ type="email"
76
+ id="email"
77
+ name="email"
78
+ value={formData.email}
79
+ onChange={handleChange}
80
+ placeholder="Enter your email"
81
+ required
82
+ />
83
+ </div>
84
+ <Button type="submit" className="w-full mt-4">
85
+ Submit
86
+ </Button>
87
+ </form>
88
+ </CardContent>
89
+ </Card>
90
+ </div>
91
+ );
92
+ };
93
+
94
+ export default HuggingFaceIntroApp;