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; ResetDraftButton: React.FC; }) => React.ReactNode; renderPublishButtons: (props: { PublishButton: React.FC; PublishPreviewButton: React.FC; }) => 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 && ( * <> * * {hasDraftVersion && } * * ); * * const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => ( * <> * * * * ); * return ( * * ); * }; * @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 ( * 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 ( * <> * setIsOpen(false)} * onPublish={handlePublish} * /> *