|
|
|
|
@ -35,6 +35,16 @@ export default class PropertyBreakdown extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderUrl(value) {
|
|
|
|
|
if (value.is_url) {
|
|
|
|
|
return (
|
|
|
|
|
<a target="_blank" href={value.name} className="hidden group-hover:block">
|
|
|
|
|
<svg className="inline h-4 w-4 ml-1 -mt-1 text-gray-600" fill="currentColor" viewBox="0 0 20 20"><path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"></path><path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"></path></svg>
|
|
|
|
|
</a>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
renderPropValue(value) {
|
|
|
|
|
const query = new URLSearchParams(window.location.search)
|
|
|
|
|
query.set('props', JSON.stringify({[this.state.propKey]: value.name}))
|
|
|
|
|
@ -43,9 +53,12 @@ export default class PropertyBreakdown extends React.Component {
|
|
|
|
|
<div className="flex items-center justify-between my-2" key={value.name}>
|
|
|
|
|
<div className="w-full h-8 relative" style={{maxWidth: 'calc(100% - 16rem)'}}>
|
|
|
|
|
<Bar count={value.count} all={this.state.breakdown} bg="bg-red-50" />
|
|
|
|
|
<Link to={{search: query.toString()}} style={{marginTop: '-26px'}} className="hover:underline block px-2">
|
|
|
|
|
{ value.name }
|
|
|
|
|
</Link>
|
|
|
|
|
<span className="flex px-2 group" style={{marginTop: '-26px'}}>
|
|
|
|
|
<Link to={{search: query.toString()}} className="hover:underline block truncate">
|
|
|
|
|
{ value.name }
|
|
|
|
|
</Link>
|
|
|
|
|
{ this.renderUrl(value) }
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<span className="font-medium inline-block w-20 text-right">{numberFormatter(value.count)}</span>
|
|
|
|
|
|