mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Co-authored-by: Paweł Kuna <1282324+codecalm@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
---
|
|
import { formatNumber } from '@shared/lib/string-format'
|
|
import CardTitle from '@ui/CardTitle.astro'
|
|
|
|
const services = 'Instagram:3550,Twitter:1798,Facebook:1245,TikTok:986,Pinterest:854,VK:650,LinkedIn:420'.split(',').map((service) => {
|
|
const [name, visitors] = service.split(':')
|
|
return { name, visitors: Number(visitors) }
|
|
})
|
|
---
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<CardTitle>Social Media Traffic</CardTitle>
|
|
</div>
|
|
<table class="table card-table table-vcenter">
|
|
<thead>
|
|
<tr>
|
|
<th>Network</th>
|
|
<th colspan="2">Visitors</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{
|
|
services.map((service) => (
|
|
<tr>
|
|
<td>{service.name}</td>
|
|
<td>{formatNumber(service.visitors)}</td>
|
|
<td class="w-50">
|
|
<div class="progress progress-xs">
|
|
<div class="progress-bar bg-primary" style={`width: ${(service.visitors / 5000.0) * 100}%`} />
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
))
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|