import React from 'react';
import { ButtonProps, AlertProps } from '@bigbinary/neetoui';

interface SchedulePaneProps {
  isOpen: boolean;
  isSubmitting: boolean;
  onPublish: (params: {
    datetimeValue: Date | null;
  }) => void;
  onClose: (params: {
    onClose: () => void;
  }) => void;
  datetime: Date | null;
}
interface PublishBlockProps {
  renderDraftButtons: (props: {
    ViewDraftButton: React.FC<ButtonProps>;
    ResetDraftButton: React.FC<ButtonProps>;
  }) => React.ReactNode;
  renderPublishButtons: (props: {
    PublishButton: React.FC<ButtonProps & {
      showTooltipWhenDisabled?: boolean;
    }>;
    PublishPreviewButton: React.FC<ButtonProps>;
  }) => React.ReactNode;
  datetime: Date | null;
}
/**
 *
 * A common component to manage draft and publish versions.
 *
 * ![image](https://user-images.githubusercontent.com/35297280/219363621-9fb295c4-72e4-4cde-b8d1-614f49e5dfa5.png|height=200|width=300)
 *
 * @example 
 *
 * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
 * 
 * const PublishActionBlock = (
 *   {
 *     //all variables used in the below example can be passed as props or can be defined in the component itself
 *   }
 * ) => {
 *   const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
 *     !isDraftBlockHidden && (
 *       <>
 *         <ViewDraftButton to={previewDraftUrl} />
 *         {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
 *       </>
 *     );
 * 
 *   const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
 *     <>
 *       <PublishButton disabled={isPublishDisabled} onClick={handlePublish} />
 *       <PublishPreviewButton
 *         disabled={isPublishPreviewDisabled}
 *         to={previewPublishedUrl}
 *       />
 *     </>
 *   );
 *   return (
 *     <PublishBlock
 *       renderDraftButtons={renderDraftButtons}
 *       renderPublishButtons={renderPublishButtons}
 *     />
 *   );
 * };
 * @endexample
 * This optional component can be used to render the reset alert modal for
 *
 * discarding draft.
 *
 * It also accepts all other alert props.
 *
 * @example 
 *
 * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
 * 
 * const PublishActionBlock = (
 *   {
 *     //all variables used in the below example can be passed as props or can be defined in the component itself
 *   }
 * ) => {
 *   return (
 *     <PublishBlock.Alert
 *       isOpen={isResetDraftAlertOpen}
 *       message="Leaving this page will delete all unpublished changes."
 *       title="Discard changes?"
 *       submitButtonLabel="Discard changes"
 *       onClose={() => setIsResetDraftAlertOpen(false)}
 *       onSubmit={action("handleReset")}
 *       //other alert props can also be passed
 *     />
 *   );
 * };
 * @endexample
 * This optional component can be used to render the publish later pane.
 *
 * @example 
 *
 * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
 * 
 * const PublishLaterPane = (
 *   {
 *     //all variables used in the below example can be passed as props or can be defined in the component itself
 *   }
 * ) => {
 *   const [isOpen, setIsOpen] = useState(false);
 * 
 *   return (
 *     <>
 *       <PublishBlock.SchedulePane
 *         {...{ isOpen }}
 *         datetime={new Date()}
 *         isSubmitting={false}
 *         onClose={() => setIsOpen(false)}
 *         onPublish={handlePublish}
 *       />
 *       <Button label="Open SchedulePane" onClick={() => setIsOpen(true)} />
 *     </>
 *   );
 * };
 * @endexample
*/
declare const PublishBlock: React.FC<PublishBlockProps> & {
  Alert: React.FC<AlertProps>;
  SchedulePane: React.FC<SchedulePaneProps>;
};

export { PublishBlock as default };
