summaryrefslogtreecommitdiff
path: root/src/components/Card.astro
blob: cbe0b0ac038b32c1566ead38d27dc7d4ccdf2301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
interface Props {
  title?: string;
  text?: string;
  linkText?: string;
  href?: string;
}

const { title, text, linkText, href } = Astro.props;
---

<div class="bg-white text-neutral-600 card">
  <div class="card-body">
    {title && <h3 class="text-neutral-900 card-title">{title}</h3>}
    {text && <p>{text}</p>}
    {
      linkText && href && (
        <div class="card-actions">
          <a
            href={href}
            class="transition link text-neutral-900 hover:opacity-80"
          >
            {linkText}
          </a>
        </div>
      )
    }
  </div>
</div>