/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/components/cards/CardImage.astro
30 строк
977 B
Paweł Kuna
Enable `astro/tsconfigs/strictest` in the shared package (#2836)
08 авг 2026, 02:27
Не верифицирован
08 авг 2026, 02:27
e520b32
Код
Авторство
О чём код?
--- import photos from '@data/photos.json' import { requireIndex } from '@shared/lib/array' interface Props { title?: string right?: boolean imgId?: number } const { title, right, imgId = 1 } = Astro.props const photo = requireIndex(photos as { file: string; title: string }[], imgId) const imgClass = `w-100 h-100 object-cover ${right ? 'card-img-end' : 'card-img-start'}` --- <div class="card"> <div class="row row-0"> <div class={`col-3${right ? ' order-md-last' : ''}`}> <!-- Photo --> <img src={`./static/photos/${photo.file}`} class={imgClass} alt={photo.title} /> </div> <div class="col"> <div class="card-body"> {title && <h3 class="card-title" set:html={title} />} <p class="text-secondary">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam deleniti fugit incidunt, iste, itaque minima neque pariatur perferendis sed suscipit velit vitae voluptatem.</p> </div> </div> </div> </div>