"use client"; import { useState } from "react"; import Link from "next/link"; import { Thought } from "@/data/creative"; import { formatReadingTime } from "@/utils/readingTime"; import Markdown from "react-markdown"; interface ExpandableThoughtProps { thought: Thought; } const categoryColors = { technology: "bg-blue-200", life: "bg-green-200", creativity: "bg-purple-200", }; export default function ExpandableThought({ thought }: ExpandableThoughtProps) { const [isExpanded, setIsExpanded] = useState(false); return (
setIsExpanded(!isExpanded)} >

{thought.title}

{isExpanded ? "▼" : "▶"}

{thought.excerpt}

Read Full Thought {thought.category} {formatReadingTime(thought.readTime)} read {new Date(thought.createdAt).toLocaleDateString("en-GB", { year: "numeric", month: "long", day: "numeric", })}
{thought.content}
); }