Backend: .NET 10 + PostgreSQL + EF Core + JWT + SignalR Frontend patient: React 19 + TypeScript + Vite (mobile H5) Frontend doctor: React 19 + TypeScript + Vite (desktop web)
17 lines
530 B
TypeScript
17 lines
530 B
TypeScript
import styles from './Input.module.css';
|
|
|
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
label?: string;
|
|
error?: string;
|
|
}
|
|
|
|
export function Input({ label, error, className = '', ...rest }: InputProps) {
|
|
return (
|
|
<div className={styles.wrapper}>
|
|
{label && <label className={styles.label}>{label}</label>}
|
|
<input className={`${styles.input} ${error ? styles.hasError : ''} ${className}`} {...rest} />
|
|
{error && <span className={styles.error}>{error}</span>}
|
|
</div>
|
|
);
|
|
}
|