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