diff --git a/components/doc/confirmdialog/responsivedoc.js b/components/doc/confirmdialog/responsivedoc.js new file mode 100644 index 0000000000..d5e665fce9 --- /dev/null +++ b/components/doc/confirmdialog/responsivedoc.js @@ -0,0 +1,146 @@ +import { DocSectionCode } from '@/components/doc/common/docsectioncode'; +import { DocSectionText } from '@/components/doc/common/docsectiontext'; +import { Button } from '@/components/lib/button/Button'; +import { ConfirmDialog } from '@/components/lib/confirmdialog/ConfirmDialog'; +import { Toast } from '@/components/lib/toast/Toast'; +import { useRef, useState } from 'react'; + +export function ResponsiveDoc(props) { + const [visible, setVisible] = useState(false); + const toast = useRef(null); + + const accept = () => { + toast.current.show({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 }); + }; + + const reject = () => { + toast.current.show({ severity: 'warn', summary: 'Rejected', detail: 'You have rejected', life: 3000 }); + }; + + const code = { + basic: ` + + setVisible(false)} + message="Are you sure you want to proceed?" + header="Confirmation" + icon="pi pi-exclamation-triangle" + accept={accept} + reject={reject} + style={{ width: '50vw' }} + breakpoints={{ '1100px': '75vw', '960px': '100vw' }} +/> +