-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathindex.tsx
56 lines (49 loc) · 1.49 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 { Modal } from '@postgres.ai/shared/components/Modal'
import { ImportantText } from '@postgres.ai/shared/components/ImportantText'
import { Text } from '@postgres.ai/shared/components/Text'
import { SimpleModalControls } from '@postgres.ai/shared/components/SimpleModalControls'
type Props = {
cloneId: string
isOpen: boolean
onClose: () => void
onDestroyClone: () => void
}
export const DestroyCloneModal = (props: Props) => {
const { cloneId, isOpen, onClose, onDestroyClone } = props
const handleClickDestroy = () => {
onDestroyClone()
onClose()
}
return (
<Modal
title={`Destroy clone ${cloneId}`}
onClose={onClose}
isOpen={isOpen}
>
<Text>
Are you sure you want to destroy clone{' '}
<ImportantText>{cloneId}</ImportantText>?
</Text>
<SimpleModalControls
items={[
{
text: 'Cancel',
onClick: onClose,
},
{
text: 'Destroy clone',
variant: 'primary',
onClick: handleClickDestroy,
}
]}
/>
</Modal>
)
}