Added padding as props

This commit is contained in:
Patrick Alvin Alcala 2025-09-24 14:02:01 +08:00
parent 03538059b1
commit c248dd80e2

View file

@ -6,13 +6,14 @@ interface Props {
color?: string
children: JSXElement
curved?: boolean
padding?: number
}
export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return (
<section class={boxClass()} style={{ border: `${props.thickness}px solid ${props.color || 'white'}` }}>
<section class={boxClass()} style={`border: ${props.thickness}px solid ${props.color || 'white'}; padding: ${props.padding}rem`}>
{props.children}
</section>
)