mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
27 lines
No EOL
892 B
TypeScript
27 lines
No EOL
892 B
TypeScript
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, okText, cancelText, onOK, ...props}: WindowProps & {
|
|
cancelText?: string,
|
|
okText?: string,
|
|
onOK?: () => void
|
|
}) {
|
|
|
|
return <Window className={cx(className, 'dialog')}
|
|
footer={
|
|
<ButtonGroup className='dialog-buttons padded'>
|
|
<Button onClick={props.onClose}>{cancelText || 'Cancel'}</Button>
|
|
{onOK && <Button type='accent' onClick={onOK}>{okText || 'OK'}</Button>}
|
|
</ButtonGroup>
|
|
}
|
|
{...props} >
|
|
|
|
<div className='dialog-content padded'>
|
|
{children}
|
|
</div>
|
|
|
|
</Window>
|
|
} |