158958d82d
closes #1793
26 lines
897 B
TypeScript
26 lines
897 B
TypeScript
import * as React from 'react';
|
|
import classNames from 'classnames';
|
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
|
|
|
type Props = Readonly<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
title?: string;
|
|
borderColor?: string;
|
|
showFlashes?: string | boolean;
|
|
}>;
|
|
|
|
export default ({ title, borderColor, showFlashes, children, ...props }: Props) => (
|
|
<div {...props}>
|
|
{title && <h2 className={'text-neutral-300 mb-4 px-4'}>{title}</h2>}
|
|
{showFlashes &&
|
|
<FlashMessageRender
|
|
byKey={typeof showFlashes === 'string' ? showFlashes : undefined}
|
|
className={'mb-4'}
|
|
/>
|
|
}
|
|
<div className={classNames('bg-neutral-700 p-4 rounded shadow-lg relative', borderColor, {
|
|
'border-t-4': !!borderColor,
|
|
})}>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
);
|