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 color?: string
children: JSXElement children: JSXElement
curved?: boolean curved?: boolean
padding?: number
} }
export default (props: Props) => { export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box')) const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return ( 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} {props.children}
</section> </section>
) )