adding prop types

This commit is contained in:
2024-02-18 19:23:55 -05:00
parent 65ff8998a0
commit 06fce5508a
3 changed files with 20 additions and 2 deletions
+6 -1
View File
@@ -1,7 +1,12 @@
--- ---
const { pathname } = Astro.url; const { pathname } = Astro.url;
const navLinks = [ type NavLink = {
label: string;
path: string;
};
const navLinks: NavLink[] = [
{ label: '📝 Blog', path: '/' }, { label: '📝 Blog', path: '/' },
{ label: '👤 About', path: '/about/' }, { label: '👤 About', path: '/about/' },
]; ];
+10 -1
View File
@@ -2,8 +2,17 @@
import BlogHeader from '@components/BlogHeader.astro'; import BlogHeader from '@components/BlogHeader.astro';
import Tags from '@components/Tags.astro'; import Tags from '@components/Tags.astro';
interface Post {
data: {
title: string;
pubDate: Date;
tags: string[];
};
slug: string;
}
interface Props { interface Props {
post: Object; post: Post;
} }
const { post } = Astro.props; const { post } = Astro.props;
+4
View File
@@ -1,4 +1,8 @@
--- ---
interface Props {
tags: string[];
}
const { tags } = Astro.props; const { tags } = Astro.props;
--- ---