import * as React from 'react' ; import { useContext } from 'react' ; import { Button } from '@components/Button' ; import { commands } from '@config/commands' ; import { FigmaContext } from '@ui/context' ; const CancelButton = ( ) => { const { figmaUIApi } = useContext ( FigmaContext ) ; const closePlugin = ( ) => { figmaUIApi . postMessage ( { pluginMessage : { command : commands . closePlugin } } , '*' ) ; } ; return < Button isSecondary type = 'reset' onClick = { closePlugin } > Cancel < /Button>; } ; export { CancelButton } ;