Handling certain types of messages

This commit is contained in:
He4eT 2021-02-28 03:25:41 +05:00
commit a36c36789d
2 changed files with 30 additions and 6 deletions

View file

@ -0,0 +1,16 @@
import { h } from 'preact'
export default function ({ style, text }) {
const defaultContent = (<span>{text}</span>)
const content = ({
emptyLine: (<br />),
subheader: (<strong>{text}</strong>)
})[style] || defaultContent
return (
<div class={['message', style].join(' ')}>
{content}
</div>
)
}