feature: Set up post editing, modify add for proper sidebar.

This commit is contained in:
Keith Solomon
2025-07-22 10:05:57 -05:00
parent efe41d13d6
commit 20f0bf29bf
5 changed files with 181 additions and 4 deletions

View File

@@ -44,7 +44,11 @@ const formatDate = (dateStr: string | undefined) => {
<details name="prompt-details">
<summary class="cursor-pointer font-semibold mt-2 text-lg">View Details</summary>
<div class="text-md border-t mt-2 pt-2">
<h3 class="text-xl font-semibold px-2">Prompt</h3>
<div class="flex justify-between items-center">
<h3 class="text-xl font-semibold px-2">Prompt</h3>
<a class="bg-green-600 text-white px-2 py-0 rounded text-sm hover:bg-green-700 transition-colors duration-300" href={`/edit?slug=${slug}`}>Edit</a>
</div>
<p class="my-2 px-2 text-balance">{description}</p>
<hr class="my-2" />
<p class="text-sm"><strong>Created:</strong> {formatDate(created_at)} &bull; <strong>Updated:</strong> {formatDate(updated_at)}</p>