Abhijith Vijayan [FLUXON] 72fa5db993 feat: use css modules
2026-01-03 19:38:23 +05:30

25 lines
602 B
TypeScript

import * as React from "react";
import type { FC, InputHTMLAttributes } from "react";
import styles from "./Input.module.scss";
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
label?: string;
}
export const Input: FC<InputProps> = ({ label, id, className, ...props }) => {
return (
<div className={styles.wrapper}>
{label && (
<label htmlFor={id} className={styles.label}>
{label}
</label>
)}
<input
id={id}
className={`${styles.input} ${className || ""}`.trim()}
{...props}
/>
</div>
);
};