fix: define component Props type instead of typecasting Astro.props

This surfaces some type errors in props being passed to some components,
particularly in the way Features passes the classes props.
This commit is contained in:
Dylan Awalt-Conley
2024-03-26 12:11:41 -04:00
parent 356854f018
commit afacd786bf
21 changed files with 57 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
---
import type { Headline } from "~/types";
import type { Headline as Props } from "~/types";
import { twMerge } from "tailwind-merge";
const {
@@ -7,7 +7,7 @@ const {
subtitle = await Astro.slots.render("subtitle"),
tagline,
classes = {},
} = Astro.props as Headline;
} = Astro.props;
const {
container: containerClass = "max-w-3xl",