Files
caperren-com/src/components/Ol.astro
Corwin Perren 37e7b3617a
All checks were successful
Build and Test - Staging / test (pull_request) Successful in 26m28s
Build and Test - Staging / build_and_push (pull_request) Successful in 5m4s
Build and Test - Staging / deploy_staging (pull_request) Successful in 3s
Extra Li wrappers removed, added word
2025-12-06 00:12:54 -08:00

37 lines
765 B
Plaintext

---
import Li from "@components/Li.astro";
import type { ComponentPropsBase } from "@interfaces/components.ts";
import type { lineItem } from "@interfaces/ul-li.ts";
interface Props extends ComponentPropsBase {
lineItems?: lineItem[];
depth?: number;
}
const { class: className, lineItems, depth = 0 } = Astro.props;
---
<ol
class:list={["list-inside list-disc", className, depth > 0 ? "ps-3" : false]}
>
{
lineItems ? (
lineItems.map((line) => (
<Li>
{line.item}
{line.subItems ? (
<Astro.self
class={className}
lineItems={line.subItems}
depth={depth + 1}
/>
) : undefined}
</Li>
))
) : (
<slot />
)
}
</ol>