mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
---
|
|
import Icon from '@ui/Icon.astro'
|
|
import ChartSparkline from '@ui/ChartSparkline.astro'
|
|
import CardTitle from '@ui/CardTitle.astro'
|
|
import urls from '@data/urls.json'
|
|
import { formatNumber } from '@shared/lib/string-format'
|
|
---
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<CardTitle>Most Visited Pages</CardTitle>
|
|
</div>
|
|
<div class="card-table table-responsive">
|
|
<table class="table table-vcenter">
|
|
<thead>
|
|
<tr>
|
|
<th>Page name</th>
|
|
<th>Visitors</th>
|
|
<th>Unique</th>
|
|
<th colspan="2">Bounce rate</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
{
|
|
urls.slice(0, 6).map((url, index) => (
|
|
<tr>
|
|
<td>
|
|
{url.uri}
|
|
<a href="#" class="ms-1" aria-label="Open website">
|
|
<Icon name="link" />
|
|
</a>
|
|
</td>
|
|
<td class="text-secondary">{formatNumber(url.visitors)}</td>
|
|
<td class="text-secondary">{formatNumber(url.unique)}</td>
|
|
<td class="text-secondary">{url.bounce}</td>
|
|
<td class="text-end w-1">
|
|
<ChartSparkline type="line" data={url.data} id={`bounce-rate-${index + 1}`} small={true} color="primary" />
|
|
</td>
|
|
</tr>
|
|
))
|
|
}
|
|
</table>
|
|
</div>
|
|
</div>
|