mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-03 06:02:54 +00:00
f71e44f91b
* Install and configure tailwind * Fix style issues
22 lines
624 B
TypeScript
22 lines
624 B
TypeScript
import type { ComponentChildren } from 'preact'
|
|
|
|
interface Props {
|
|
title?: ComponentChildren,
|
|
link?: string,
|
|
overlay?: ComponentChildren,
|
|
children?: ComponentChildren,
|
|
}
|
|
export function Card({ title, overlay, link, children }: Props) {
|
|
const content = <>
|
|
{overlay && <span class="card-overlay">{overlay}</span>}
|
|
<div class="card-content">
|
|
{title && <h3 class="card-title font-bold text-[1.17em]">{title}</h3>}
|
|
{children}
|
|
</div>
|
|
</>
|
|
|
|
return link === undefined
|
|
? <div class="card">{content}</div>
|
|
: <a class="card" href={link} target={link.startsWith('https://') ? '_blank' : undefined}>{content}</a>
|
|
}
|