refactor: remove singular component and replace with wrapper component

This commit is contained in:
Nam Doan
2025-12-10 14:09:46 +07:00
parent baaa0e9c62
commit fe881d5aed
6 changed files with 133 additions and 93 deletions
@@ -0,0 +1,25 @@
import { clx } from "@medusajs/ui"
import {
LayoutComponentDefinition,
LayoutContext,
} from "@vibentec/component-map"
export interface VtImageConfig {
src: string
alt: string
className?: string,
objectFit?: string,
}
export default function VtLogo({
nodes,
context,
}: {
nodes: LayoutComponentDefinition
context: LayoutContext
}) {
const props = (nodes.config as VtImageConfig) ?? {}
return (
<div className={clx("relative", props.className)}>
<img src={props.src} alt={props.alt} className={clx("w-full h-full", props.objectFit)} />
</div>
)
}