2023-07-27 23:26:07 +01:00
|
|
|
|
{{ $calloutEmojiDict := dict "info" "ℹ️" "warning" "⚠️" "error" "🚫" }}
|
|
|
|
|
{{ $type := .Get "type" | default "default" }}
|
|
|
|
|
{{/* If emoji is not set, use the emoji from dict */}}
|
|
|
|
|
{{ $emoji := .Get "emoji" }}
|
|
|
|
|
{{ if eq $emoji "" }}
|
|
|
|
|
{{ $emoji = index $calloutEmojiDict $type }}
|
|
|
|
|
{{ end }}
|
2023-10-29 11:19:31 -04:00
|
|
|
|
{{/* Also allow using "icon" */}}
|
|
|
|
|
{{ $icon := .Get "icon" }}
|
2023-07-27 23:26:07 +01:00
|
|
|
|
|
|
|
|
|
{{ $defaultClass := "border-orange-100 bg-orange-50 text-orange-800 dark:border-orange-400/30 dark:bg-orange-400/20 dark:text-orange-300" }}
|
|
|
|
|
{{ $infoClass := "border-blue-200 bg-blue-100 text-blue-900 dark:border-blue-200/30 dark:bg-blue-900/30 dark:text-blue-200" }}
|
|
|
|
|
{{ $warningClass := "border-yellow-100 bg-yellow-50 text-yellow-900 dark:border-yellow-200/30 dark:bg-yellow-700/30 dark:text-yellow-200" }}
|
|
|
|
|
{{ $errorClass := "border-red-200 bg-red-100 text-red-900 dark:border-red-200/30 dark:bg-red-900/30 dark:text-red-200" }}
|
|
|
|
|
|
|
|
|
|
{{ $class := cond (eq $type "info") $infoClass (cond (eq $type "warning") $warningClass (cond (eq $type "error") $errorClass $defaultClass)) }}
|
|
|
|
|
|
2023-10-29 11:19:31 -04:00
|
|
|
|
|
2023-07-27 23:26:07 +01:00
|
|
|
|
<div class="overflow-x-auto mt-6 flex rounded-lg border py-2 ltr:pr-4 rtl:pl-4 contrast-more:border-current contrast-more:dark:border-current {{ $class }}">
|
2023-10-29 11:19:31 -04:00
|
|
|
|
<div class="ltr:pl-3 ltr:pr-2 rtl:pr-3 rtl:pl-2">
|
|
|
|
|
{{- with $emoji -}}
|
|
|
|
|
<div class="select-none text-xl" style="font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">
|
|
|
|
|
{{ . }}
|
|
|
|
|
</div>
|
|
|
|
|
{{- else -}}
|
|
|
|
|
{{- with $icon }}
|
|
|
|
|
{{ partial "utils/icon.html" (dict "name" . "attributes" `height=1.2em class="inline-block align-middle"`) -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-07-27 23:26:07 +01:00
|
|
|
|
<div class="w-full min-w-0 leading-7">
|
2023-10-13 00:09:57 +01:00
|
|
|
|
<div class="mt-6 leading-7 first:mt-0">
|
2023-07-27 23:26:07 +01:00
|
|
|
|
{{ .Inner | markdownify }}
|
2023-10-13 00:09:57 +01:00
|
|
|
|
</div>
|
2023-07-27 23:26:07 +01:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|