added blog post page, reverted back to flex blog landing, added types

This commit is contained in:
2025-02-25 13:22:45 -05:00
parent addb2e55d9
commit c4e11c2e02
11 changed files with 75 additions and 34 deletions

View File

@ -1,10 +1,11 @@
import { convertUtc } from "../lib/convertUtc.ts";
import { truncateString } from "../lib/truncate.ts";
import { Post } from "../types/index.ts";
export const PostCard = function PostCard({ post }: { post: Post }) {
return (
<div class="p-6 bg-[#45475a] rounded-lg shadow-md transition-all duration-300 ease-in-out hover:shadow-xl hover:scale-105">
<a href={`${Deno.env.get("BASE_URI_WEB")}/posts/${post.slug}`}>
<a href={`${Deno.env.get("BASE_URI_WEB")}/posts/${post.post_id}`}>
<h2 class="text-white text-lg font-bold mb-2">{post.title}</h2>
<p class="text-white">
Written by{" "}
@ -21,14 +22,3 @@ export const PostCard = function PostCard({ post }: { post: Post }) {
</div>
);
};
export type Post = {
post_id: number;
author_id: number;
first_name: string;
last_name: string;
title: string;
body: string;
created_at: string;
slug: string;
};