import React, { FC, useState } from 'react' import { Button, ExternalLink } from '@wordpress/components' import { Icon } from '@wordpress/icons' import { __ } from '@wordpress/i18n' import { pluginPageLink } from '../landing/pluginPage' import { Tip, tips } from './tipList' import TipModal from './TipModal' import './tips.scss' export type TipsLayout = 'row' | 'quiet' const READ_MORE_VARIANT: Record = { row: 'secondary', quiet: 'link', } const TipCard: FC<{ tip: Tip layout: TipsLayout onReadMore: () => void }> = ({ tip, layout, onReadMore }) => (
  • {tip.title}

    {tip.summary}

  • ) /** * "Did you know?": teaches the merchant features they may have missed, on the * pages where they handle their orders. Each tip opens a modal that explains * it and links to where it is set up. */ const Tips: FC<{ layout?: TipsLayout }> = ({ layout = 'row' }) => { const [openTip, setOpenTip] = useState(undefined) return (

    {__('Did you know?', 'posten-bring-checkout')}

    {__('See all updates', 'posten-bring-checkout')}
      {tips().map(tip => ( setOpenTip(tip)} /> ))}
    {openTip && ( setOpenTip(undefined)} /> )}
    ) } export default Tips