Private
Public Access
41 lines
712 B
Svelte
41 lines
712 B
Svelte
<script lang="ts">
|
|
import { type Snippet } from 'svelte';
|
|
|
|
interface Props {
|
|
title?: string;
|
|
children: Snippet;
|
|
err?: Boolean;
|
|
}
|
|
|
|
let { title, children, err = false }: Props = $props();
|
|
</script>
|
|
|
|
<div class="card {err ? 'err' : ''}">
|
|
{#if title}
|
|
<h2 class="card-title">{title}</h2>
|
|
{/if}
|
|
{@render children()}
|
|
</div>
|
|
|
|
<style>
|
|
.card {
|
|
background: var(--cds-layer-02, #262626);
|
|
padding: 2rem;
|
|
border-radius: 8px;
|
|
width: 100%;
|
|
max-width: 400px;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.card-title {
|
|
margin-bottom: 0.5rem;
|
|
color: var(--cds-text-primary, #f4f4f4);
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.err {
|
|
background: rgba(255, 0, 0, 0.7) !important;
|
|
}
|
|
</style>
|