/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/Trending.astro
21 строка
656 B
Paweł Kuna
Enable `astro/tsconfigs/strictest` in the shared package (#2836)
08 авг 2026, 02:27
Не верифицирован
08 авг 2026, 02:27
e520b32
Код
Авторство
О чём код?
--- import Icon from './Icon.astro' interface Props { value?: number unit?: string | undefined class?: string } const { value = 25, unit = '%', class: className } = Astro.props const trendingColor = value > 0 ? 'green' : value === 0 ? 'muted' : 'red' const trendingIcon = value > 0 ? 'arrow-up' : value === 0 ? 'minus' : 'arrow-down' const classes = [`text-${trendingColor} d-inline-flex align-items-center lh-1`, className] --- <span class:list={classes}> <span class="visually-hidden">{value > 0 ? 'Increased by' : value < 0 ? 'Decreased by' : 'No change,'} </span>{value}{unit} <Icon name={trendingIcon} class="ms-0" size="sm" /> </span>