mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
1 parent
00dcf3864f
commit
ab12ca8526
10 files changed
+115
-97
No files matched your search
@@ -3,6 +3,7 @@ import classNames from 'classnames';
|
||||
|
||||
export default function DataInputComponent(props) {
|
||||
const {
|
||||
html,
|
||||
title,
|
||||
value,
|
||||
onChange,
|
||||
@@ -12,16 +13,20 @@ export default function DataInputComponent(props) {
|
||||
const cn = classNames(className, 'flex-col flex-fill');
|
||||
return (
|
||||
<div {...rest} className={cn}>
|
||||
<textarea
|
||||
className="scratchpad__data-input"
|
||||
wrap="off"
|
||||
value={value}
|
||||
onChange={(ev) => {
|
||||
ev.stopPropagation();
|
||||
onChange(ev.target.value);
|
||||
}}
|
||||
placeholder={title}
|
||||
/>
|
||||
{html // eslint-disable-next-line react/no-danger
|
||||
? <div className="scratchpad__data-input" wrap="off" dangerouslySetInnerHTML={{ __html: value }} />
|
||||
: (
|
||||
<textarea
|
||||
className="scratchpad__data-input"
|
||||
wrap="off"
|
||||
value={value}
|
||||
onChange={(ev) => {
|
||||
ev.stopPropagation();
|
||||
onChange(ev.target.value);
|
||||
}}
|
||||
placeholder={title}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user