mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
* Midway doing something * Small refactor * Some mobile responsiveness * bit fix * Update name * One more name * One more name, again * Footer and faqs * Fix * Style fixes * Style fixes * Add titles * Add CTAs to copy, download or load SQL in supabase * Styling * mobile * Add suggestions * Add delete action * Cleanup * Add delete thread and edit thread modals * Restore server action * Fix build error * Import common theme switcher * Add file * Restore thread list * force revalidating profile path --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
28 lines
870 B
TypeScript
28 lines
870 B
TypeScript
'use client'
|
|
|
|
import { useParams } from 'next/navigation'
|
|
import { useMessagesQuery } from '@/data/messages-query'
|
|
import { UserMessage } from '@/lib/types'
|
|
|
|
const CurrentThreadName = () => {
|
|
const { threadId, runId, messageId }: { threadId: string; runId: string; messageId: string } =
|
|
useParams()
|
|
|
|
const isConversation = threadId !== undefined && runId !== undefined
|
|
|
|
const { data } = useMessagesQuery({ threadId, runId, enabled: isConversation })
|
|
const selectedMessage = data?.messages.find((m) => m.id === messageId) as UserMessage
|
|
|
|
return (
|
|
<div className="hidden xl:block flex items-center gap-x-4">
|
|
{selectedMessage !== undefined && (
|
|
<p title={selectedMessage.text} className="truncate max-w-[700px] border-l text-sm px-4">
|
|
{selectedMessage.text}
|
|
</p>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default CurrentThreadName
|