Started creating the page to generate exams

This commit is contained in:
Tiago Ribeiro
2023-11-20 16:19:05 +00:00
parent 13c8459d4b
commit 4753b85ab5
4 changed files with 327 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import {useState} from "react";
interface Props {
type: "email" | "text" | "password" | "tel" | "number";
roundness?: "full" | "xl";
required?: boolean;
label?: string;
placeholder?: string;
@@ -13,7 +14,18 @@ interface Props {
onChange: (value: string) => void;
}
export default function Input({type, label, placeholder, name, required = false, defaultValue, className, disabled = false, onChange}: Props) {
export default function Input({
type,
label,
placeholder,
name,
required = false,
defaultValue,
className,
roundness = "full",
disabled = false,
onChange,
}: Props) {
const [showPassword, setShowPassword] = useState(false);
if (type === "password") {
@@ -59,7 +71,11 @@ export default function Input({type, label, placeholder, name, required = false,
disabled={disabled}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool disabled:bg-mti-gray-platinum/40 disabled:text-mti-gray-dim disabled:cursor-not-allowed bg-white rounded-full border border-mti-gray-platinum focus:outline-none"
className={clsx(
"px-8 py-6 text-sm font-normal bg-white border border-mti-gray-platinum focus:outline-none",
"placeholder:text-mti-gray-cool disabled:bg-mti-gray-platinum/40 disabled:text-mti-gray-dim disabled:cursor-not-allowed",
roundness === "full" ? "rounded-full" : "rounded-xl",
)}
required={required}
defaultValue={defaultValue}
/>