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,7 +1,14 @@
---
import type { HTMLTag } from "astro/types";
import type { Widget } from "~/types";
import { twMerge } from "tailwind-merge";
import Background from "./Background.astro";
export interface Props extends Widget {
containerClass?: string;
["as"]?: HTMLTag;
}
const { id, isDark = false, containerClass = "", bg, as = "section" } = Astro.props;
const WrapperTag = as;