44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
---
|
|
import { Image } from "astro:assets"
|
|
import { Icon } from "astro-icon/components";
|
|
import "dayjs/locale/es";
|
|
import "dayjs/locale/fr";
|
|
import "dayjs/locale/he";
|
|
import "dayjs/locale/uk";
|
|
import "dayjs/locale/pt";
|
|
import "dayjs/locale/ru";
|
|
import "dayjs/locale/rw";
|
|
import dayjs from "dayjs";
|
|
import utc from "dayjs/plugin/utc";
|
|
import { getLocalizedRoute } from "../../i18n";
|
|
|
|
const locale = Astro.currentLocale || "es";
|
|
const regionNames = new Intl.DisplayNames([locale], { type: 'region' });
|
|
dayjs.extend(utc);
|
|
dayjs.locale(locale);
|
|
|
|
const { data } = Astro.props;
|
|
const nicedate = dayjs.utc(data.data.date).format("D MMMM YYYY");
|
|
const countryName = data?.data?.country ? regionNames.of(data.data.country) : "";
|
|
|
|
const locationArray = [data.data.city,countryName]
|
|
locationArray.filter(Boolean).join(', ');
|
|
---
|
|
|
|
<div class="bg-[#EBE5D0] text-[#003421] p-10">
|
|
<Icon name="ph:arrow-circle-down-thin" class="text-8xl mb-8" />
|
|
<p class="font-light text-2xl mb-8">
|
|
{locationArray.filter(Boolean).join(', ')}<br />
|
|
({nicedate}):
|
|
</p>
|
|
<h3 class="text-2xl font-bold mb-8"><a href={`/${locale}/${getLocalizedRoute('news', locale)}/${data.id}`}>{data.data.title}</a></h3>
|
|
|
|
<div>
|
|
<Image
|
|
src={data.data.thumbnail}
|
|
alt={data.data.title}
|
|
class="aspect-square object-cover"
|
|
/>
|
|
</div>
|
|
</div>
|