ratrapage_T-WEB/front/src/components/ui/WidgetWrapper.astro
Clement b151a5e464
Some checks failed
Build Docker Image Front / run (pull_request) Failing after 39s
Build Docker Image Back / run (pull_request) Successful in 21s
JsDocs / coverage (pull_request) Successful in 23s
Test and coverage / coverage (pull_request) Successful in 1m33s
fix: ci build
2024-05-20 17:10:48 +02:00

32 lines
857 B
Plaintext

---
import type { HTMLTag } from 'astro/types';
import type { Widget } from 'types';
import { twMerge } from 'tailwind-merge';
import Background from './Background.astro';
export interface Props extends Widget {
containerClass?: string;
['as']?: HTMLTag;
}
const { id, isDark = false, containerClass = '', bg, as = 'section' } = Astro.props;
const WrapperTag = as;
---
<WrapperTag class="relative not-prose scroll-mt-[72px]" {...id ? { id } : {}}>
<div class="absolute inset-0 pointer-events-none -z-[1]" aria-hidden="true">
<slot name="bg">
{bg ? <Fragment set:html={bg} /> : <Background isDark={isDark} />}
</slot>
</div>
<div
class:list={[
twMerge('relative mx-auto max-w-7xl px-4 md:px-6 py-12 md:py-16 lg:py-20 text-default', containerClass),
{ dark: isDark },
]}
>
<slot />
</div>
</WrapperTag>