import { JSXElement, mergeProps } from 'solid-js'
interface ComponentProps {
children: JSXElement | JSXElement[]
headerText: string
class?: string
}
export default function Card(props: ComponentProps) {
const defaults: { class: string } = { class: 'bg-base-200 p-4' }
console.log(defaults, props)
const merged = mergeProps(props, defaults)
console.log(merged)
return (
<div>
<div class="border-b border-neutral-700 text-3xl text-center card-header mb-4 pb-2">{props.headerText}</div>
{props.children}
</div>
)
}
import { JSXElement, mergeProps } from 'solid-js'
interface ComponentProps {
children: JSXElement | JSXElement[]
headerText: string
class?: string
}
export default function Card(props: ComponentProps) {
const defaults: { class: string } = { class: 'bg-base-200 p-4' }
console.log(defaults, props)
const merged = mergeProps(props, defaults)
console.log(merged)
return (
<div>
<div class="border-b border-neutral-700 text-3xl text-center card-header mb-4 pb-2">{props.headerText}</div>
{props.children}
</div>
)
}