diff --git a/src/components/Time.tsx b/src/components/Time.tsx new file mode 100644 index 0000000..eff23d6 --- /dev/null +++ b/src/components/Time.tsx @@ -0,0 +1,14 @@ +import { format } from "date-fns"; +import type { FunctionComponent } from "react"; + +type TimeProps = { + time: Date; +} + +const Time: FunctionComponent = ({ time }) => { + return ( + + ); +}; + +export default Time; diff --git a/src/layouts/Post.astro b/src/layouts/Post.astro index 484bf5a..0361f17 100644 --- a/src/layouts/Post.astro +++ b/src/layouts/Post.astro @@ -1,15 +1,15 @@ --- import General from "@layouts/General.astro"; -import { type CollectionEntry } from 'astro:content'; -import { format } from "date-fns"; - +import Time from "@components/Time.jsx"; +import { type CollectionEntry } from "astro:content"; interface Props { - post: CollectionEntry<'blog'>; + post: CollectionEntry<"blog">; } const { post } = Astro.props; const { title, pubDate, tags } = post.data; const tagCount = tags.length; --- +

@@ -18,16 +18,16 @@ const tagCount = tags.length;

- - - - - {tags.map((tag, i) => ( - <>{ tag }{ i < tagCount - 1 ? ',' : ''} - ))} - +