refactor: update common input and text component
This commit is contained in:
@@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user