From bce557cc2dc767628bed6aac87301a1be7c5431b Mon Sep 17 00:00:00 2001
From: rxliuli <rxliuli@gmail.com>
Date: Tue, 4 Nov 2025 05:03:50 +0800
Subject: init commit

---
 .../jet/shelf/HorizontalRuleShelf.svelte           | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 src/components/jet/shelf/HorizontalRuleShelf.svelte

(limited to 'src/components/jet/shelf/HorizontalRuleShelf.svelte')

diff --git a/src/components/jet/shelf/HorizontalRuleShelf.svelte b/src/components/jet/shelf/HorizontalRuleShelf.svelte
new file mode 100644
index 0000000..3313ff2
--- /dev/null
+++ b/src/components/jet/shelf/HorizontalRuleShelf.svelte
@@ -0,0 +1,54 @@
+<script lang="ts" context="module">
+    import type {
+        HorizontalRule,
+        HorizontalRuleStyle,
+        Shelf,
+    } from '@jet-app/app-store/api/models';
+
+    export interface HorizontalRuleShelf extends Shelf {
+        contentType: 'horizontalRule';
+        items: [HorizontalRule];
+    }
+
+    export function isHorizontalRuleShelf(
+        shelf: Shelf,
+    ): shelf is HorizontalRuleShelf {
+        return (
+            shelf.contentType === 'horizontalRule' && Array.isArray(shelf.items)
+        );
+    }
+
+    function horizontalRuleStyleToBorderStyle(
+        style: HorizontalRuleStyle,
+    ): string {
+        return style.toLowerCase();
+    }
+</script>
+
+<script lang="ts">
+    import ShelfWrapper from '~/components/Shelf/Wrapper.svelte';
+    import { colorAsString } from '~/utils/color';
+
+    export let shelf: HorizontalRuleShelf;
+
+    $: item = shelf.items[0];
+    $: borderStyle = horizontalRuleStyleToBorderStyle(item.style);
+</script>
+
+<ShelfWrapper {shelf} withBottomPadding={false}>
+    <hr
+        style:color={colorAsString(item.color)}
+        style:border-style={borderStyle}
+    />
+</ShelfWrapper>
+
+<style>
+    hr {
+        display: block;
+        height: 1px;
+        border-width: 1px 0 0;
+        border-color: currentColor;
+        margin: 1em var(--bodyGutter);
+        padding: 0;
+    }
+</style>
-- 
cgit v1.2.3

