mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 02:19:45 +00:00
36 lines
1.1 KiB
React
36 lines
1.1 KiB
React
import "./Field.styles.scss";
|
|
|
|
function Field({ type, name, placeholder, icon }) {
|
|
const className = type === "submit" ? "submit btn"
|
|
: type === "textarea" ? "field big"
|
|
: "field";
|
|
|
|
return (
|
|
<>
|
|
{type === "textarea" ? (
|
|
<textarea
|
|
className={className}
|
|
name={name}
|
|
placeholder={placeholder}
|
|
/>
|
|
) : type === "file" ? (
|
|
<label className="file-input">
|
|
<input type="file" name="file" />
|
|
<div className="upload-file-btn">
|
|
<img src={icon} alt="" className="icon" />
|
|
<span>Прикрепить файл</span>
|
|
</div>
|
|
</label>
|
|
) : (
|
|
<input
|
|
className={className}
|
|
type={type}
|
|
name={name}
|
|
placeholder={placeholder}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default Field; |