import { h, Html } from 'lib/rx'
interface Params {
header: Html,
body: Html,
onClose: () => void
}
export function view({ header, body, onClose }: Params): Html {
return h('div',
{ className: 'g-Modal',
onclick: () => onClose()
},
h('div',
{ className: 'g-Modal__Content',
onclick: (e: Event) => e.stopPropagation()
},
h('div',
{ className: 'g-Modal__Header' },
header,
h('button',
{ className: 'g-Modal__Close',
onclick: () => onClose()
},
'✕'
)
),
h('div',
{ className: 'g-Modal__Body' },
body
)
)
)
}