assistant markdown update

This commit is contained in:
Logan
2026-06-21 14:38:53 -04:00
parent 21268ab477
commit 21d15d0426
3 changed files with 22 additions and 2 deletions
+1
View File
@@ -145,6 +145,7 @@ Current itinerary:{itinerary}
Guidelines:
- Be conversational and concise — don't over-explain.
- Format all responses using Markdown: use **bold** for place names and key details, bullet lists for options, and [links](url) for Maps links.
- When the user mentions places, activities, or asks for suggestions, search for them with search_places before proposing.
- Use propose_event for each concrete suggestion — one call per event. The user will approve or skip each one.
- Be mindful of the existing schedule when assigning times. Avoid obvious conflicts.
+19 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useRef, useState } from "react";
import ReactMarkdown from "react-markdown";
import { useParams, useRouter } from "next/navigation";
import { useAuth } from "@/components/AuthProvider";
import { c2api } from "@/lib/c2api";
@@ -614,7 +615,24 @@ function AssistantPanel({
: "bg-gray-800 text-gray-200"
}`}
>
{msg.content}
{msg.role === "user" ? msg.content : (
<ReactMarkdown
components={{
p: ({ children }) => <p className="mb-1 last:mb-0">{children}</p>,
ul: ({ children }) => <ul className="list-disc list-inside space-y-0.5 my-1">{children}</ul>,
ol: ({ children }) => <ol className="list-decimal list-inside space-y-0.5 my-1">{children}</ol>,
li: ({ children }) => <li>{children}</li>,
strong: ({ children }) => <strong className="font-semibold text-white">{children}</strong>,
a: ({ href, children }) => (
<a href={href} target="_blank" rel="noopener noreferrer" className="text-indigo-400 hover:text-indigo-300 underline">
{children}
</a>
),
}}
>
{msg.content}
</ReactMarkdown>
)}
</div>
{/* Suggestion cards */}
+2 -1
View File
@@ -14,7 +14,8 @@
"react-dom": "^18.3.0",
"firebase": "^10.12.0",
"leaflet": "^1.9.4",
"react-leaflet": "^4.2.1"
"react-leaflet": "^4.2.1",
"react-markdown": "^9.0.1"
},
"devDependencies": {
"typescript": "^5.4.0",