blob: 56249dd73b96b2d5bd78426c519b33a23f490d33 [file] [log] [blame]
Samuel Shuerta42ca962024-04-27 16:13:23 -04001---
2
3import active from '../images/active.svg';
4import wip from '../images/wip.svg';
5import inactive from '../images/inactive.svg';
6
7export enum Status {
8 Active,
9 Inactive,
10 WIP
11}
12
13interface Props {
14 name: string,
15 url: string,
16 children: string;
17 status: Status;
18}
19
20const { name, url, status } = Astro.props;
21
22let color: string;
23let icon: string;
24
25switch (status) {
26 case Status.Active: {
27 color = "bg-green";
28 icon = active.src;
29 break;
30 }
31 case Status.WIP: {
32 color = "bg-yellow";
33 icon = wip.src;
34 break;
35 }
36 default:
37 case Status.Inactive: {
38 color = "bg-red";
39 icon = inactive.src;
40 break;
41 }
42}
43---
44
45<a href={url} class="w-72 h-36 flex flex-col rounded-lg p-2 m-2 bg-surface0 shadow-md shadow-crust transition-transform hover:bg-surface1 hover:drop-shadow-md hover:-translate-y-1">
46 <div class="flex justify-between mr-1 mb-1 items-end">
47 <p class="text-text text-lg">{name}</p>
48 <img src={icon} alt="cross" class="h-8"/>
49 </div>
50 <div class={`h-[2px] w-full mb-1 ${color}`}/>
51 <p class="text-text text-sm text-ellipsis overflow-hidden"><slot /></p>
52</a>