/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/components/cards/MostVisitedPages.astro
44 строки
1 KB
Paweł Kuna
Add quality gates: Prettier for Astro, astro check for shared, unused SCSS variable lint (#2749)
03 авг 2026, 01:47
Не верифицирован
03 авг 2026, 01:47
8962710
Код
Авторство
О чём код?
--- 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>