import React, { useState } from 'react';
import MetricsTable from './MetricsTable';
import { refFilter } from 'lib/filters';
import ButtonGroup from '../common/ButtonGroup';
export default function Referrers({
websiteId,
websiteDomain,
startDate,
endDate,
limit,
onExpand = () => {},
}) {
const [filter, setFilter] = useState('Combined');
const renderLink = ({ x: url }) => {
return url.startsWith('http') ? (
{decodeURI(url)}
) : (
decodeURI(url)
);
};
return (
}
websiteId={websiteId}
websiteDomain={websiteDomain}
startDate={startDate}
endDate={endDate}
limit={limit}
dataFilter={refFilter}
filterOptions={{
domain: websiteDomain,
domainOnly: filter === 'Domain only',
raw: filter === 'Raw',
}}
onExpand={onExpand}
renderLabel={renderLink}
/>
);
}
const FilterButtons = ({ selected, onClick }) => {
return (
);
};