diff --git a/src/components/FilteredPromptList.astro b/src/components/FilteredPromptList.astro index bdc6207..7ba2b6f 100644 --- a/src/components/FilteredPromptList.astro +++ b/src/components/FilteredPromptList.astro @@ -3,8 +3,6 @@ import PromptCard from './PromptCard.astro'; const { prompts = [] } = Astro.props; -// console.log("📋 FilteredPromptList loaded with prompts:", prompts.length, prompts); - type Prompt = { slug: string; title: string; @@ -17,7 +15,9 @@ type Prompt = { }; --- -

+
+

+
{prompts.map((p: Prompt) => ( diff --git a/src/components/FilteredPromptList.jsx b/src/components/FilteredPromptList.jsx deleted file mode 100644 index fc35182..0000000 --- a/src/components/FilteredPromptList.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useEffect, useState } from 'react'; -import PromptCard from './PromptCard.astro'; // or use Astro version if needed - -export default function FilteredPromptList({ prompts }) { - const [filtered, setFiltered] = useState(prompts); - - useEffect(() => { - const params = new URLSearchParams(window.location.search); - const type = params.get('type'); - const tag = params.get('tag'); - - const result = prompts.filter((p) => { - const matchesType = !type || p.type === type; - const matchesTag = !tag || (p.tags && p.tags.includes(tag)); - return matchesType && matchesTag; - }); - - setFiltered(result); - }, [prompts]); - - return ( -
- {filtered.map((p) => ( - - ))} -
- ); -} diff --git a/src/components/PromptCard.astro b/src/components/PromptCard.astro index 627ecc5..049ddee 100644 --- a/src/components/PromptCard.astro +++ b/src/components/PromptCard.astro @@ -6,7 +6,8 @@ const { description, tags = [], created_at, - updated_at + updated_at, + notes, } = Astro.props; const formatDate = (dateStr: string | undefined) => { @@ -44,7 +45,7 @@ const formatDate = (dateStr: string | undefined) => { View Details

Created: {formatDate(created_at)} • Updated: {formatDate(updated_at)}

-

📝 Misc data, unused currently

+

📝 {notes}

diff --git a/src/pages/index.astro b/src/pages/index.astro index 71888b3..0c6a140 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,15 +1,13 @@ --- import MainLayout from '../layouts/MainLayout.astro'; -import Sidebar from '../components/Sidebar.astro'; import SearchBar from '../components/SearchBar.astro'; -// import PromptList from '../components/PromptList.astro'; import FilteredPromptList from '../components/FilteredPromptList.astro'; import { supabase } from '../lib/supabase'; const { data: prompts, error } = await supabase .from('prompts') .select('*') - .order('created_at', { ascending: false }); + .order('title', { ascending: true }); const allTags = Array.from( new Set( diff --git a/src/pages/ping.endtype.ts b/src/pages/ping.endtype.ts deleted file mode 100644 index 4be4550..0000000 --- a/src/pages/ping.endtype.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const GET = async () => { - return new Response("pong", { - headers: { 'Content-Type': 'text/plain' } - }); -}; diff --git a/src/pages/prompt-details/test.endpoint.ts b/src/pages/prompt-details/test.endpoint.ts deleted file mode 100644 index 2e53725..0000000 --- a/src/pages/prompt-details/test.endpoint.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { APIRoute } from 'astro'; - -const data = { - "summarize-document": { - createdAt: "2025-06-01", - updatedAt: "2025-07-10", - notes: "Summarizes input using GPT-4 with smart chunking." - }, - "translate-text": { - createdAt: "2025-05-15", - updatedAt: "2025-06-22", - notes: "Uses multilingual model for more accurate translation." - }, - "generate-code": { - createdAt: "2025-06-05", - updatedAt: "2025-07-01", - notes: "Includes language detection and function wrapping." - } -}; - -export const GET: APIRoute = async ({ params, request }) => { - console.log("HTMX request received for:", request.url); - console.log("Slug param is:", params.slug); - - const slug = params.slug!; - const prompt = data[slug as keyof typeof data]; - - if (!prompt) { - return new Response(`
View Details

Prompt not found.

`, { - status: 404, - headers: { 'Content-Type': 'text/html' } - }); - } - - const html = ` -
- View Details -
-

Created: ${prompt.createdAt} • Updated: ${prompt.updatedAt}

-

📝 ${prompt.notes}

-
-
- `; - - return new Response(html, { - headers: { 'Content-Type': 'text/html' } - }); -};