next-enterprise/package/components/atoms/Input.tsx

43 lines
797 B
TypeScript
Raw Normal View History

2024-09-19 19:22:43 -05:00
"use client"
import { TextField } from "@mui/material"
import React from "react"
interface InputProps {
type: string
name?: string;
2024-09-19 19:22:43 -05:00
placeholder?: string
value: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
2024-09-19 19:22:43 -05:00
autocomplete?: string
disabled?: boolean
2024-09-19 19:22:43 -05:00
}
const Input: React.FC<InputProps> = ({
type,
name,
placeholder,
value,
onChange,
onKeyDown,
autocomplete,
disabled
}) => {
2024-09-19 19:22:43 -05:00
return (
<TextField
type={type}
name={name}
2024-09-19 19:22:43 -05:00
placeholder={placeholder}
value={value}
onChange={onChange}
onKeyDown={onKeyDown}
2024-09-19 19:22:43 -05:00
autoComplete={autocomplete}
fullWidth
variant="outlined"
disabled={disabled}
2024-09-19 19:22:43 -05:00
/>
)
}
export default Input