refactor: update common input and text component

This commit is contained in:
Nam Doan 2025-12-03 22:10:07 +07:00
parent efe48a200f
commit f3fb70d073
2 changed files with 19 additions and 1 deletions

View File

@ -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 ?? ""}
/>
)
}

View File

@ -12,7 +12,7 @@ export default function VtText({
const props = nodes.config || {}
return (
<span className={props?.className ?? ""}>
{props?.label && <span>{props.label}</span>}
{props?.label ?? ""}
</span>
)
}