mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Refactoring components
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user