| 1 |
import { chevronLeft, Icon } from '@wordpress/icons'; |
| 2 |
|
| 3 |
const TITLE = [ |
| 4 |
'text-ui-heading md:text-ui-heading-lg text-pretty text-ui-page-text', |
| 5 |
'font-ui-heading font-ui-strong tracking-ui-heading p-0 m-0 text-center', |
| 6 |
].join(' '); |
| 7 |
|
| 8 |
const SUBTITLE = [ |
| 9 |
'text-sm md:text-ui-body text-pretty text-ui-page-text font-ui-body', |
| 10 |
'opacity-70 p-0 m-0 text-center max-w-xl', |
| 11 |
].join(' '); |
| 12 |
|
| 13 |
const LINK = [ |
| 14 |
'inline-flex items-center gap-0.5 border-0 bg-transparent cursor-pointer', |
| 15 |
'text-sm text-ui-page-text opacity-70 hover:opacity-100 transition-opacity', |
| 16 |
].join(' '); |
| 17 |
|
| 18 |
export const Heading = ({ title, subtitle }) => ( |
| 19 |
<div className="flex flex-col items-center gap-2"> |
| 20 |
<h2 className={TITLE}>{title}</h2> |
| 21 |
{subtitle && <p className={SUBTITLE}>{subtitle}</p>} |
| 22 |
</div> |
| 23 |
); |
| 24 |
|
| 25 |
export const PageLink = ({ label, href, icon = chevronLeft, onClick }) => |
| 26 |
href ? ( |
| 27 |
<a className={LINK} href={href} onClick={onClick}> |
| 28 |
<Icon fill="currentColor" icon={icon} size={20} /> |
| 29 |
{label} |
| 30 |
</a> |
| 31 |
) : ( |
| 32 |
<button className={LINK} type="button" onClick={onClick}> |
| 33 |
<Icon fill="currentColor" icon={icon} size={20} /> |
| 34 |
{label} |
| 35 |
</button> |
| 36 |
); |
| 37 |
|