mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
25 lines
602 B
TypeScript
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>
|
|
);
|
|
};
|