feat: store AP note extensions in JSONB and render movies-diary posts as rich cards
This commit is contained in:
@@ -37,6 +37,7 @@ import {
|
||||
Trash2,
|
||||
} from "lucide-react";
|
||||
import { ThoughtForm } from "@/components/thought-form";
|
||||
import { MovieCard } from "@/components/movie-card";
|
||||
import Link from "next/link";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
@@ -74,6 +75,17 @@ export function ThoughtCard({
|
||||
|
||||
const isAuthor = currentUser?.username === thought.author.username;
|
||||
|
||||
const meta = thought.noteExtensions as Record<string, unknown> | null | undefined;
|
||||
if (meta?.movieTitle) {
|
||||
return (
|
||||
<MovieCard
|
||||
meta={meta as unknown as Parameters<typeof MovieCard>[0]["meta"]}
|
||||
author={thought.author}
|
||||
createdAt={new Date(thought.createdAt)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const handleDelete = async () => {
|
||||
setIsAlertOpen(false);
|
||||
setDeletingState("shaking");
|
||||
|
||||
Reference in New Issue
Block a user