mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 13:17:00 +04:00
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
---
|
|
import Icon from '@ui/Icon.astro'
|
|
import Sparkline from '@ui/Sparkline.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">
|
|
<Sparkline values={url.data} id={`bounce-rate-${index + 1}`} size="sm" color="primary" ariaLabel={`Bounce rate trend for ${url.uri}`} />
|
|
</td>
|
|
</tr>
|
|
))
|
|
}
|
|
</table>
|
|
</div>
|
|
</div>
|