50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import React, { useState } from "react";
|
|
|
|
interface ContactSplitFormProps {
|
|
tag: string;
|
|
title: string;
|
|
description: string;
|
|
background?: { variant: string };
|
|
useInvertedBackground?: boolean;
|
|
inputPlaceholder?: string;
|
|
buttonText?: string;
|
|
termsText?: string;
|
|
}
|
|
|
|
export default function ContactSplitForm({
|
|
tag,
|
|
title,
|
|
description,
|
|
background = { variant: "sparkles-gradient" },
|
|
useInvertedBackground = false,
|
|
inputPlaceholder = "Enter your email", buttonText = "Sign Up", termsText = "By clicking Sign Up you're confirming that you agree with our Terms and Conditions."}: ContactSplitFormProps) {
|
|
const [email, setEmail] = useState("");
|
|
|
|
const handleSubmit = (e: React.FormEvent) => {
|
|
e.preventDefault();
|
|
setEmail("");
|
|
};
|
|
|
|
return (
|
|
<div className="contact-split-form-container">
|
|
<div className="contact-tag">{tag}</div>
|
|
<h2 className="contact-title">{title}</h2>
|
|
<p className="contact-description">{description}</p>
|
|
<form onSubmit={handleSubmit} className="contact-form">
|
|
<input
|
|
type="email"
|
|
placeholder={inputPlaceholder}
|
|
value={email}
|
|
onChange={(e) => setEmail(e.target.value)}
|
|
required
|
|
className="contact-input"
|
|
/>
|
|
<button type="submit" className="contact-button">
|
|
{buttonText}
|
|
</button>
|
|
</form>
|
|
<p className="contact-terms">{termsText}</p>
|
|
</div>
|
|
);
|
|
}
|