mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-22 16:33:38 +01:00
dialog component
This commit is contained in:
parent
a3b1df5e5e
commit
a1663c26b2
1 changed files with 25 additions and 0 deletions
25
modules/ui/components/Dialog.tsx
Normal file
25
modules/ui/components/Dialog.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import React from "react";
|
||||
import Window, {WindowProps} from "ui/components/Window";
|
||||
import cx from 'classnames';
|
||||
import ButtonGroup from "ui/components/controls/ButtonGroup";
|
||||
import Button from "ui/components/controls/Button";
|
||||
|
||||
export function Dialog({children, className, onOK, ...props}: WindowProps & {
|
||||
onOK: () => void
|
||||
}) {
|
||||
|
||||
return <Window className={cx(className, 'dialog')}
|
||||
footer={
|
||||
<ButtonGroup className='dialog-buttons padded'>
|
||||
<Button onClick={props.onClose}>Cancel</Button>
|
||||
<Button type='accent' onClick={onOK}>OK</Button>
|
||||
</ButtonGroup>
|
||||
}
|
||||
{...props} >
|
||||
|
||||
<div className='dialog-content padded'>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
</Window>
|
||||
}
|
||||
Loading…
Reference in a new issue