import React, { FC, ReactNode, useId } from 'react' import { Button, Dialog, Link, Stack } from '@wordpress/ui' import { useI18n } from '@wordpress/react-i18n' import BookShippingGuide from './BookShippingGuide' import PrintLabelsGuide from './PrintLabelsGuide' import { pluginPageLink } from './pluginPage' interface DailyUseTask { title: string text: string guide: ReactNode extra?: ReactNode } /** One daily task, with a button that opens its guide in a dialog. */ const DailyUseItem: FC = ({ title, text, guide, extra }) => { const { __ } = useI18n() const headingId = useId() const buttonId = useId() return (
  • {title}

    {text}

    {extra}
    } > {__('Show guide', 'posten-bring-checkout')} {title} {guide}
  • ) } export declare interface DailyUseProps { /** Whether the user may open the plugin settings */ canConfigure: boolean } const DailyUse: FC = ({ canConfigure }) => { const { __ } = useI18n() const tasks: Array = [ { title: __('Book shipping', 'posten-bring-checkout'), text: __( 'Book shipping for one order, or for several orders at once.', 'posten-bring-checkout' ), guide: , }, { title: __('Print labels', 'posten-bring-checkout'), text: __( 'Print the labels of one order, or of several orders at once.', 'posten-bring-checkout' ), guide: , extra: canConfigure && ( {__('Turn on automatic label printing', 'posten-bring-checkout')} ), }, ] return (
      {tasks.map(task => ( ))}
    ) } export default DailyUse