XYZ File Manager
Current Path:
/var/www/wordpress/wp-content/plugins/code-snippets/js/components/common
var
/
www
/
wordpress
/
wp-content
/
plugins
/
code-snippets
/
js
/
components
/
common
/
📁
..
📄
Badge.tsx
(838 B)
📄
Button.tsx
(929 B)
📄
ConfirmDialog.tsx
(1.1 KB)
📄
CopyToClipboardButton.tsx
(1.64 KB)
📄
DismissableNotice.tsx
(700 B)
📄
SubmitButton.tsx
(913 B)
📄
Tooltip.tsx
(681 B)
📄
UpsellBanner.tsx
(1.16 KB)
📄
UpsellDialog.tsx
(2.11 KB)
📁
icons
Editing: ConfirmDialog.tsx
import React from 'react' import { __ } from '@wordpress/i18n' import { Button, Flex, Modal } from '@wordpress/components' import type { ReactNode } from 'react' export interface ConfirmDialogProps { open?: boolean title: string onConfirm?: VoidFunction onCancel: VoidFunction confirmLabel?: string cancelLabel?: string children?: ReactNode, confirmButtonClassName?: string } export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({ open, title, onConfirm, onCancel, children, confirmLabel = __('OK', 'code-snippets'), cancelLabel = __('Cancel', 'code-snippets'), confirmButtonClassName }) => open ? <Modal title={title} onRequestClose={onCancel} closeButtonLabel={cancelLabel} isDismissible={true} onKeyDown={event => { if ('Enter' === event.key) { onConfirm?.() } }} > {children} <Flex direction="row" justify="flex-end"> <Button variant="tertiary" onClick={onCancel}> {cancelLabel} </Button> <Button variant="primary" onClick={onConfirm} className={confirmButtonClassName}> {confirmLabel} </Button> </Flex> </Modal> : null
Upload File
Create Folder