umami/components/layout/PageHeader.js

26 lines
667 B
JavaScript
Raw Normal View History

2020-08-09 08:48:43 +02:00
import React from 'react';
import Link from 'next/link';
2020-09-22 06:34:55 +02:00
import classNames from 'classnames';
import { Button, Icon } from 'react-basics';
2020-08-07 09:24:01 +02:00
import styles from './PageHeader.module.css';
export default function PageHeader({ title, backUrl, children, className, style }) {
return (
<div className={classNames(styles.header, className)} style={style}>
<div className={styles.title}>
{backUrl && (
<Link href={backUrl}>
<a>
<Button>
<Icon icon="arrow-left" /> Back
</Button>
</a>
</Link>
)}
{title}
</div>
{children}
</div>
);
2020-08-07 09:24:01 +02:00
}