mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
38 lines
671 B
TypeScript
38 lines
671 B
TypeScript
import { BigField, SmallField } from './styles';
|
|
import { Props } from './types';
|
|
|
|
const Input = ({
|
|
type = 'text',
|
|
variant = 'small',
|
|
name,
|
|
value,
|
|
required,
|
|
placeholder,
|
|
className,
|
|
onChange,
|
|
}: Props) => {
|
|
return variant === 'small' ? (
|
|
<SmallField
|
|
type={type}
|
|
name={name}
|
|
value={value}
|
|
required={required}
|
|
placeholder={placeholder}
|
|
className={className}
|
|
onChange={onChange}
|
|
/>
|
|
) : (
|
|
<BigField
|
|
name={name}
|
|
value={value}
|
|
required={required}
|
|
placeholder={placeholder}
|
|
className={className}
|
|
onChange={onChange}
|
|
rows={3}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Input;
|