/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/Empty.astro
45 строк
1 KB
Paweł Kuna
Narrow component prop types, remove unused props and dead code (#2838)
10 авг 2026, 00:14
Не верифицирован
10 авг 2026, 00:14
4f7beec
Код
Авторство
О чём код?
--- import Icon from './Icon.astro' import Button from './Button.astro' import Illustration from './Illustration.astro' interface Props { icon?: string height?: number | string class?: string /** illustration file name, e.g. "computer-fix.svg" */ illustration?: string | undefined /** icon-text param — big text rendered instead of an icon/illustration */ iconText?: string | undefined title?: string subtitle?: string | undefined buttonText?: string buttonIcon?: string } const { icon = 'mood-sad', height = 256, class: className, illustration, iconText, title = 'No results found', subtitle = "Try adjusting your search or filter to find what you're looking for.", buttonText = 'Search again', buttonIcon = 'search' } = Astro.props const classes = ['empty', className] --- <div class:list={classes}> { illustration ? ( <div class="empty-img"> <Illustration image={illustration} height={height} /> </div> ) : iconText ? ( <div class="empty-header" set:html={iconText} /> ) : ( <div class="empty-icon"> <Icon name={icon} /> </div> ) } <p class="empty-title" set:html={title} /> <p class="empty-subtitle text-secondary" set:html={subtitle} /> <div class="empty-action"> <Button text={buttonText} color="primary" icon={buttonIcon} href="." /> </div> </div>