diff options
author | Paul Valladares | 2023-11-25 05:24:10 -0600 |
---|---|---|
committer | GitHub | 2023-11-25 12:24:10 +0100 |
commit | 14f9dbd6f4be4619b4bd000706a1c461e5b7b471 (patch) | |
tree | 9a765c1a0e1222c55392e5bba6f9be2d807650bf | |
parent | 6f101c8029c25dec43602e15f295c240f21d139f (diff) | |
download | IT.starlight-14f9dbd6f4be4619b4bd000706a1c461e5b7b471.tar.gz IT.starlight-14f9dbd6f4be4619b4bd000706a1c461e5b7b471.tar.bz2 IT.starlight-14f9dbd6f4be4619b4bd000706a1c461e5b7b471.zip |
refactor: destructure props in `SidebarSublist.astro` (#1149)
-rw-r--r-- | packages/starlight/components/SidebarSublist.astro | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/starlight/components/SidebarSublist.astro b/packages/starlight/components/SidebarSublist.astro index 417e2dbf..399d191f 100644 --- a/packages/starlight/components/SidebarSublist.astro +++ b/packages/starlight/components/SidebarSublist.astro @@ -7,17 +7,19 @@ interface Props { sublist: SidebarEntry[]; nested?: boolean; } + +const { sublist, nested } = Astro.props; --- -<ul class:list={{ 'top-level': !Astro.props.nested }}> +<ul class:list={{ 'top-level': !nested }}> { - Astro.props.sublist.map((entry) => ( + sublist.map((entry) => ( <li> {entry.type === 'link' ? ( <a href={entry.href} aria-current={entry.isCurrent && 'page'} - class:list={[{ large: !Astro.props.nested }, entry.attrs.class]} + class:list={[{ large: !nested }, entry.attrs.class]} {...entry.attrs} > <span>{entry.label}</span> |