-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathindex.tsx
56 lines (50 loc) · 1.29 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*--------------------------------------------------------------------------
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
* All Rights Reserved. Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited
*--------------------------------------------------------------------------
*/
import React from 'react'
import { makeStyles } from '@material-ui/core'
import { Button } from '@postgres.ai/shared/components/Button'
type Props = {
items: {
text: string
variant?: 'primary' | 'secondary'
onClick: () => void
isDisabled?: boolean
}[]
}
const useStyles = makeStyles(
{
root: {
display: 'flex',
justifyContent: 'flex-end',
marginTop: '16px',
},
button: {
marginLeft: '8px',
},
},
{ index: 1 },
)
export const SimpleModalControls = (props: Props) => {
const classes = useStyles()
return (
<div className={classes.root}>
{props.items.map((item) => {
return (
<Button
key={item.text}
className={classes.button}
onClick={item.onClick}
variant={item.variant}
isDisabled={item.isDisabled}
>
{item.text}
</Button>
)
})}
</div>
)
}