umami/components/metrics/ReferrersTable.js
2023-04-21 08:00:42 -07:00

34 lines
791 B
JavaScript

import MetricsTable from './MetricsTable';
import FilterLink from 'components/common/FilterLink';
import useMessages from 'hooks/useMessages';
export 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}
/>
</>
);
}
export default ReferrersTable;