refactor: update common input and text component
This commit is contained in:
parent
efe48a200f
commit
f3fb70d073
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { LayoutComponentDefinition, LayoutContext } from "@vibentec/component-map"
|
||||||
|
|
||||||
|
export default function VtInput({
|
||||||
|
nodes,
|
||||||
|
context,
|
||||||
|
}: {
|
||||||
|
nodes: LayoutComponentDefinition
|
||||||
|
context: LayoutContext
|
||||||
|
}) {
|
||||||
|
const props = nodes.config || {}
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
className={props?.className ?? ""}
|
||||||
|
type={props?.type ?? "text"}
|
||||||
|
placeholder={props?.placeholder ?? ""}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ export default function VtText({
|
||||||
const props = nodes.config || {}
|
const props = nodes.config || {}
|
||||||
return (
|
return (
|
||||||
<span className={props?.className ?? ""}>
|
<span className={props?.className ?? ""}>
|
||||||
{props?.label && <span>{props.label}</span>}
|
{props?.label ?? ""}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue