Files
soft/frontend-patient/src/components/common/Input.tsx
MingNian 435af55c4a Initial commit: HealthManager full-stack health management platform
Backend: .NET 10 + PostgreSQL + EF Core + JWT + SignalR
Frontend patient: React 19 + TypeScript + Vite (mobile H5)
Frontend doctor: React 19 + TypeScript + Vite (desktop web)
2026-05-20 16:18:56 +08:00

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>
);
}