refactor: update component props and improve types (#600)

- stop exporting component Props
- replace interface with type for component Props
- enhance dynamic rendering in several components
This commit is contained in:
Sat Naing
2026-01-05 22:56:38 +07:00
committed by GitHub
parent f5f863f9d2
commit 7141d82dbd
9 changed files with 40 additions and 53 deletions
+8 -4
View File
@@ -1,16 +1,20 @@
---
import type { HTMLAttributes } from "astro/types";
import Socials from "./Socials.astro";
const currentYear = new Date().getFullYear();
export interface Props {
type Props = {
noMarginTop?: boolean;
}
} & HTMLAttributes<"footer">;
const { noMarginTop = false } = Astro.props;
const { noMarginTop = false, class: className, ...attrs } = Astro.props;
---
<footer class:list={["app-layout", { "mt-auto": !noMarginTop }]}>
<footer
class:list={["app-layout", { "mt-auto": !noMarginTop }, className]}
{...attrs}
>
<div
class:list={[
"py-6 sm:py-4",