umami/components/metrics/WebsiteHeader.js

33 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-08-18 09:51:32 +02:00
import React from 'react';
2020-09-06 02:27:01 +02:00
import { FormattedMessage } from 'react-intl';
2020-09-16 04:16:05 +02:00
import Link from 'components/common/Link';
2020-08-18 09:51:32 +02:00
import PageHeader from 'components/layout/PageHeader';
import RefreshButton from 'components/common/RefreshButton';
import ButtonLayout from 'components/layout/ButtonLayout';
import Icon from 'components/common/Icon';
2020-08-18 09:51:32 +02:00
import ActiveUsers from './ActiveUsers';
import Arrow from 'assets/arrow-right.svg';
import styles from './WebsiteHeader.module.css';
export default function WebsiteHeader({ websiteId, token, title, showLink = false }) {
2020-08-18 09:51:32 +02:00
return (
<PageHeader>
<div className={styles.title}>{title}</div>
<ActiveUsers className={styles.active} websiteId={websiteId} token={token} />
<ButtonLayout>
2020-08-31 23:11:30 +02:00
<RefreshButton websiteId={websiteId} />
{showLink && (
2020-09-16 04:16:05 +02:00
<Link
href="/website/[...id]"
as={`/website/${websiteId}/${title}`}
className={styles.link}
>
2020-09-16 04:16:05 +02:00
<FormattedMessage id="button.view-details" defaultMessage="View details" />
<Icon icon={<Arrow />} size="small" />
</Link>
)}
</ButtonLayout>
2020-08-18 09:51:32 +02:00
</PageHeader>
);
}