HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpmuhibbah/wp-content/plugins/give/src/Views/Components/AdminDetailsPage/types.ts
import React, { FC } from 'react';

/**
 * Interface for controlling UI element visibility
 *
 * @since 4.4.0
 */
export interface Show {
    contextMenu?: boolean;
    confirmationModal?: boolean;
}

/**
 * Props for the AdminDetailsPage component
 *
 * @since 4.4.0
 */
export interface AdminDetailsPageProps<T extends Record<string, any>> {
    /**
     * ID of the object being displayed/edited
     */
    objectId: string | number;

    /**
     * Type of object (e.g., 'donor', 'campaign', etc.)
     */
    objectType: string;

    /**
     * Plural type of object (e.g., 'donors', 'campaigns', etc.)
     */
    objectTypePlural: string;

    /**
     * Hook that provides entity data and methods
     */
    useObjectEntityRecord: (id: string | number) => {
        record: T;
        hasResolved: boolean;
        save: () => Promise<T>;
        edit: (data: Partial<T>) => void;
    };

    /**
     * Function to reset the form
     */
    resetForm?: (reset: () => void) => void;

    /**
     * Function to determine if the form should be saved
     */
    shouldSaveForm?: (isDirty: boolean, data: T) => boolean;

    /**
     * URL for the breadcrumb link
     */
    breadcrumbUrl: string;

    /**
     * Custom title for the breadcrumb (defaults to entity.name)
     */
    breadcrumbTitle?: string;

    /**
     * Custom title for the page header (defaults to entity.name)
     */
    pageTitle?: string;

    /**
     * Component to display the status badge
     */
    StatusBadge?: React.ComponentType;

    /**
     * Component to display the primary action button
     */
    PrimaryActionButton?: React.ComponentType<{ isSaving: boolean, formState: any, className: string }>;

    /**
     * Component to display the secondary action button
     */
    SecondaryActionButton?: React.ComponentType<{ className: string }>;

    /**
     * Component to display the context menu items
     */
    ContextMenuItems?: React.ComponentType<{ className: string }>;

    /**
     * Tabs definition for the object
     */
    tabDefinitions: Tab[];

    /**
     * Component to display the children
     */
    children?: React.ReactNode;
}

/**
 * @since 4.4.0
 */
export type Tab = {
    id: string;
    title: string;
    content: FC;
    fullwidth?: boolean;
};

/**
 * @since 4.4.0
 */
export type Notification = {
    id: string;
    content: string | JSX.Element | Function;
    notificationType?: 'notice' | 'snackbar';
    type?: 'error' | 'warning' | 'info' | 'success';
    isDismissible?: boolean;
    autoHide?: boolean;
    onDismiss?: () => void;
    duration?: number,
}

/**
 * @since 4.4.0
 */
declare module "@wordpress/data" {
    export function select(key: 'givewp/admin-details-page-notifications'): {
        getNotifications(): Notification[],
        getNotificationsByType(type: 'snackbar' | 'notice'): Notification[]
    };

    export function dispatch(key: 'givewp/admin-details-page-notifications'): {
        addSnackbarNotice(notification: Notification): void,
        addNotice(notification: Notification): void,
        dismissNotification(id: string): void
    };
}