-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form.jsx
67 lines (60 loc) · 1.96 KB
/
Form.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Link from "next/link";
const Form = ({ type, post, setPost, submitting, handleSubmit }) => {
return (
<section className='w-full max-w-full flex-start flex-col'>
<h1 className='head_text text-left'>
<span className='blue_gradient'>{type} Post</span>
</h1>
<p className='desc text-left max-w-md'>
{type} and share amazing prompts with the world, and let your
imagination run wild with any AI-powered platform
</p>
<form
onSubmit={handleSubmit}
className='mt-10 w-full max-w-2xl flex flex-col gap-7 glassmorphism'
>
<label>
<span className='font-satoshi font-semibold text-base text-gray-700'>
Your AI Prompt
</span>
<textarea
value={post.prompt}
onChange={(e) => setPost({ ...post, prompt: e.target.value })}
placeholder='Write your post here'
required
className='form_textarea '
/>
</label>
<label>
<span className='font-satoshi font-semibold text-base text-gray-700'>
Field of Prompt{" "}
<span className='font-normal'>
(#product, #webdevelopment, #idea, etc.)
</span>
</span>
<input
value={post.tag}
onChange={(e) => setPost({ ...post, tag: e.target.value })}
type='text'
placeholder='#Tag'
required
className='form_input'
/>
</label>
<div className='flex-end mx-3 mb-5 gap-4'>
<Link href='/' className='text-gray-500 text-sm'>
Cancel
</Link>
<button
type='submit'
disabled={submitting}
className='px-5 py-1.5 text-sm bg-primary-orange rounded-full text-white'
>
{submitting ? `${type}ing...` : type}
</button>
</div>
</form>
</section>
);
};
export default Form;