Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Commit e6e8aeb

Browse files
committed
(#30) Allow content prop to be optional on <Callout />
This allows the `content` prop to be optional on the `<Callout />` component.
1 parent 92b6c7c commit e6e8aeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Callout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type CalloutTitle = Callout['title'];
1313
type CalloutType = Callout['type'];
1414
1515
interface Props {
16-
content: Callout
16+
content?: Callout
1717
title: CalloutTitle
1818
type: CalloutType
1919
}
@@ -28,7 +28,7 @@ if (title) {
2828
title = '';
2929
}
3030
31-
type = type ? type : content.type;
31+
type = type ? type : (content && content.type ? content.type : 'none');
3232
let icon = '';
3333
3434
switch (type) {

0 commit comments

Comments
 (0)