/ src / components / Update.astro
Update.astro
 1  ---
 2  export type Props = {
 3  	date: string;
 4  };
 5  
 6  const props = Astro.props as Props;
 7  const formattedDate = new Date(props.date).toLocaleDateString("en-GB", {
 8  	weekday: "short",
 9  	year: "numeric",
10  	month: "long",
11  	day: "numeric",
12  });
13  ---
14  
15  <section
16  	class="bg-white border border-pink-200 border-l-3 border-l-pink-600 not-prose"
17  >
18  	<div
19  		class="py-2 px-4 bg-gradient-to-r from-pink-50 to-purple-50 text-pink-600 font-heading flex items-center justify-between"
20  	>
21  		<span class="font-semibold font-sans">UPDATE</span>
22  		<span class="text-pink-600/80 font-sans">{formattedDate}</span>
23  	</div>
24  	<div class="p-4 bg-white leading-relaxed font-body text-pink-950/80">
25  		<slot />
26  	</div>
27  </section>