mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
32 lines
767 B
JavaScript
32 lines
767 B
JavaScript
import MetricsTable from './MetricsTable';
|
|
import FilterLink from 'components/common/FilterLink';
|
|
import useMessages from 'hooks/useMessages';
|
|
|
|
export default function ReferrersTable({ websiteId, ...props }) {
|
|
const { formatMessage, labels } = useMessages();
|
|
|
|
const renderLink = ({ x: referrer }) => {
|
|
return (
|
|
<FilterLink
|
|
id="referrer"
|
|
value={referrer}
|
|
externalUrl={`https://${referrer}`}
|
|
label={!referrer && formatMessage(labels.none)}
|
|
/>
|
|
);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<MetricsTable
|
|
{...props}
|
|
title={formatMessage(labels.referrers)}
|
|
type="referrer"
|
|
metric={formatMessage(labels.views)}
|
|
websiteId={websiteId}
|
|
renderLabel={renderLink}
|
|
/>
|
|
</>
|
|
);
|
|
}
|