diff --git a/shared/components/cards/music/TracksList.astro b/shared/components/cards/music/TracksList.astro
index 6f7c16fda..3d3cf8c8e 100644
--- a/shared/components/cards/music/TracksList.astro
+++ b/shared/components/cards/music/TracksList.astro
@@ -6,6 +6,7 @@ import ListGroup from '@ui/ListGroup.astro'
import ListGroupItem from '@ui/ListGroupItem.astro'
import tracks from '@data/tracks.json'
import { millisecondsToMinutes } from '@shared/lib/string-format'
+import { requireIndex } from '@shared/lib/array'
const items = tracks.slice(0, 12)
---
@@ -18,7 +19,7 @@ const items = tracks.slice(0, 12)
{index + 1}
-

+
{track.name}
diff --git a/shared/components/layout/HeaderActionsButtons.astro b/shared/components/layout/HeaderActionsButtons.astro
index ae28a820b..a0dae8194 100644
--- a/shared/components/layout/HeaderActionsButtons.astro
+++ b/shared/components/layout/HeaderActionsButtons.astro
@@ -8,7 +8,7 @@ import ReportModalContent from '../modals/ReportModalContent.astro'
interface Props {
/** layout-navbar-overlap && layout-navbar-dark → the "New view" button is color="dark" */
- dark?: boolean
+ dark?: boolean | undefined
}
const { dark } = Astro.props
diff --git a/shared/components/layout/HeaderProfile.astro b/shared/components/layout/HeaderProfile.astro
index 37e23ffbd..9a57df632 100644
--- a/shared/components/layout/HeaderProfile.astro
+++ b/shared/components/layout/HeaderProfile.astro
@@ -4,8 +4,9 @@ import Icon from '@ui/Icon.astro'
import Button from '@ui/Button.astro'
import ButtonList from '@ui/ButtonList.astro'
import people from '@data/people.json'
+import { requireIndex } from '@shared/lib/array'
-const person = people[3]
+const person = requireIndex(people, 3)
---
diff --git a/shared/components/layout/PageHeader.astro b/shared/components/layout/PageHeader.astro
index eb155e9be..0a216360a 100644
--- a/shared/components/layout/PageHeader.astro
+++ b/shared/components/layout/PageHeader.astro
@@ -15,21 +15,21 @@ import HeaderUptime from './HeaderUptime.astro';
interface Props {
/** page-header — the page title; without it the whole block is not rendered */
- title?: string;
+ title?: string | undefined;
/** page-header-pretitle */
- pretitle?: string;
+ pretitle?: string | undefined;
/** page-header-description */
- description?: string;
+ description?: string | undefined;
/** page-header-actions — name of an include from layout/header-actions/, e.g. "buttons" */
- actions?: string;
+ actions?: string | undefined;
/** page-header-class */
class?: string;
/** page-header-icon */
icon?: string;
/** page-header-file — name of an include from layout/headers/, e.g. "profile" */
- file?: string;
+ file?: string | undefined;
/** layout-navbar-overlap && layout-navbar-dark → text-white on .page-header */
- textWhite?: boolean;
+ textWhite?: boolean | undefined;
}
const { title, pretitle, description, actions, class: className, icon, file, textWhite } = Astro.props;
diff --git a/shared/components/marketing/SectionDivider.astro b/shared/components/marketing/SectionDivider.astro
index de32b9064..d27017521 100644
--- a/shared/components/marketing/SectionDivider.astro
+++ b/shared/components/marketing/SectionDivider.astro
@@ -1,7 +1,7 @@
---
// Renders nothing unless divider is 'waves' or 'arc'.
interface Props {
- divider?: string
+ divider?: string | undefined
}
const { divider } = Astro.props
diff --git a/shared/components/modals/AddTaskModalContent.astro b/shared/components/modals/AddTaskModalContent.astro
index dd91fbdb8..0bb31ecbc 100644
--- a/shared/components/modals/AddTaskModalContent.astro
+++ b/shared/components/modals/AddTaskModalContent.astro
@@ -2,13 +2,14 @@
// selected ids "5,6,2,3" → people[id-1].
import people from '@data/people.json'
import FormGroup from '@ui/FormGroup.astro'
+import { requireIndex } from '@shared/lib/array'
interface Person {
id: string
full_name: string
}
-const selectedPeople = ['5', '6', '2', '3'].map((idStr) => (people as Person[])[Number(idStr) - 1])
+const selectedPeople = ['5', '6', '2', '3'].map((idStr) => requireIndex(people as Person[], Number(idStr) - 1))
---