39 lines
728 B
Text
39 lines
728 B
Text
|
---
|
||
|
import Tag from './Tag.astro'
|
||
|
|
||
|
interface Props {
|
||
|
pubDate: Date
|
||
|
slug: string
|
||
|
title: string
|
||
|
tags: { name: string, slug: string }[]
|
||
|
}
|
||
|
const { pubDate, slug, title, tags } = Astro.props
|
||
|
---
|
||
|
|
||
|
<div class="note">
|
||
|
<div class="date">{pubDate.toLocaleDateString("ru", {year: "numeric", month: "long", day: "numeric"})}</div>
|
||
|
<div class="dash">—</div>
|
||
|
<a href={`/notes/${slug}/`}>{ title }</a>
|
||
|
{tags.map(tag => <Tag slug={tag.slug} name={tag.name} />)}
|
||
|
</div>
|
||
|
|
||
|
<style>
|
||
|
.note {
|
||
|
margin-bottom: 15px;
|
||
|
}
|
||
|
.dash {
|
||
|
display: none;
|
||
|
}
|
||
|
|
||
|
@media screen and (min-width: 600px) {
|
||
|
.note {
|
||
|
display: flex;
|
||
|
gap: 6px;
|
||
|
margin-bottom: 5px;
|
||
|
}
|
||
|
.dash {
|
||
|
display: block;
|
||
|
}
|
||
|
}
|
||
|
</style>
|