Samuel Shuert | 932ddda | 2024-10-12 14:13:49 -0400 | [diff] [blame^] | 1 | --- |
| 2 | |
| 3 | import active from '../images/active.svg'; |
| 4 | import wip from '../images/wip.svg'; |
| 5 | import { Status } from './Project.astro'; |
| 6 | |
| 7 | |
| 8 | interface Props { |
| 9 | name: string, |
| 10 | url: string, |
| 11 | status: Status; |
| 12 | } |
| 13 | |
| 14 | const { name, url, status } = Astro.props; |
| 15 | |
| 16 | let color: string; |
| 17 | let icon: string; |
| 18 | |
| 19 | switch (status) { |
| 20 | case Status.Active: { |
| 21 | color = "bg-green"; |
| 22 | icon = active.src; |
| 23 | break; |
| 24 | } |
| 25 | default: |
| 26 | case Status.Inactive: |
| 27 | case Status.WIP: { |
| 28 | color = "bg-yellow"; |
| 29 | icon = wip.src; |
| 30 | break; |
| 31 | } |
| 32 | } |
| 33 | --- |
| 34 | |
| 35 | <a href={url} class="w-max h-fit 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"> |
| 36 | <div class="flex justify-between mr-1 mb-1 items-end gap-2"> |
| 37 | <p class="text-text text-lg">{name}</p> |
| 38 | <img src={icon} alt="cross" class="h-8 self-start"/> |
| 39 | </div> |
| 40 | </a> |