Spaces:
Configuration error
Configuration error
File size: 1,459 Bytes
74aacd5 |
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 57 58 59 60 61 62 63 |
import React, { useEffect, useState } from 'react'
import { useRecoilState, useRecoilValue } from 'recoil'
import {
interactiveSegClicksState,
isInteractiveSegRunningState,
isInteractiveSegState,
} from '../../store/Atoms'
import Button from '../shared/Button'
interface Props {
onCancelClick: () => void
onAcceptClick: () => void
}
const InteractiveSegConfirmActions = (props: Props) => {
const { onCancelClick, onAcceptClick } = props
const [isInteractiveSeg, setIsInteractiveSeg] = useRecoilState(
isInteractiveSegState
)
const [isInteractiveSegRunning, setIsInteractiveSegRunning] = useRecoilState(
isInteractiveSegRunningState
)
const [clicks, setClicks] = useRecoilState(interactiveSegClicksState)
const clearState = () => {
setIsInteractiveSeg(false)
setIsInteractiveSegRunning(false)
setClicks([])
}
return (
<div
className="interactive-seg-confirm-actions"
style={{
visibility: isInteractiveSeg ? 'visible' : 'hidden',
}}
>
<div className="action-buttons">
<Button
onClick={() => {
clearState()
onCancelClick()
}}
>
Cancel
</Button>
<Button
border
onClick={() => {
clearState()
onAcceptClick()
}}
>
Accept
</Button>
</div>
</div>
)
}
export default InteractiveSegConfirmActions
|