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

@@ -3,7 +3,7 @@ import Headline from '~/components/ui/Headline.astro';
import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
import Button from '~/components/ui/Button.astro';
import Image from '~/components/common/Image.astro';
import type { Testimonials } from '~/types';
import type { Testimonials as Props } from '~/types';
const {
@@ -17,7 +17,7 @@ const {
isDark = false,
classes = {},
bg = await Astro.slots.render('bg'),
} = Astro.props as Testimonials;
} = Astro.props;
---
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-6xl mx-auto ${classes?.container ?? ''}`} bg={bg}>