
| Current Path : /var/www/html/c12park/vendor/twbs/bootstrap/site/src/components/shortcodes/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/vendor/twbs/bootstrap/site/src/components/shortcodes/Callout.astro |
---
import { getCalloutByName } from '@libs/content'
import type { MarkdownInstance } from 'astro'
interface Props {
/**
* The name of an existing callout to display located in `src/content/callouts`.
* This will override any content passed in via the default slot.
*/
name?:
| 'danger-async-methods'
| 'info-mediaqueries-breakpoints'
| 'info-npm-starter'
| 'info-prefersreducedmotion'
| 'info-sanitizer'
| 'warning-color-assistive-technologies'
| 'warning-data-bs-title-vs-title'
| 'warning-input-support'
/**
* The type of callout to display. One of `info`, `danger`, or `warning`.
* @default 'info'
*/
type?: 'danger' | 'info' | 'warning'
}
const { name, type = 'info' } = Astro.props
let Content: MarkdownInstance<{}>['Content'] | undefined
if (name) {
const callout = await getCalloutByName(name)
if (!callout) {
throw new Error(`Could not find callout with name '${name}'.`)
}
const namedCallout = await callout.render()
Content = namedCallout.Content
}
---
<div class={`bd-callout bd-callout-${type}`}>
{Content ? <Content /> : <slot />}
</div>