This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
servicepoint-tanks/tank-frontend/src/components/Dialog.tsx
Vinzenz Schroeter 59459019fc sticky dialog title
2024-05-07 13:41:10 +02:00

22 lines
636 B
TypeScript

import {ReactNode} from 'react';
import Column from './Column.tsx';
import Row from './Row.tsx';
import Button from './Button.tsx';
import './Dialog.css';
export default function Dialog({children, className, title, onClose}: {
title?: string;
children?: ReactNode;
className?: string;
onClose?: () => void;
}) {
return <Column className={'Dialog ' + (className ?? '')}>
<Row>
<h3 className="flex-grow">{title}</h3>
{onClose && <Button text="x" onClick={onClose}/>}
</Row>
<Column className='overflow-scroll'>
{children}
</Column>
</Column>;
}