summaryrefslogtreecommitdiff
path: root/examples/hackernews/src/components/Show.astro
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hackernews/src/components/Show.astro')
-rw-r--r--examples/hackernews/src/components/Show.astro9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/hackernews/src/components/Show.astro b/examples/hackernews/src/components/Show.astro
new file mode 100644
index 000000000..7e0887784
--- /dev/null
+++ b/examples/hackernews/src/components/Show.astro
@@ -0,0 +1,9 @@
+---
+export interface Props<T> {
+ when: T | number | boolean | undefined | null;
+}
+
+const { when } = Astro.props;
+---
+
+{!!when ? <slot /> : <slot name="fallback" />}