diff --git a/web/src/pages/index.tsx b/web/src/pages/index.tsx index fe2827b..ad01c9b 100644 --- a/web/src/pages/index.tsx +++ b/web/src/pages/index.tsx @@ -8,6 +8,12 @@ import { useState } from "react"; import Header from "../header"; import SearchBox from "../searchbox"; +type Citation = { + title: string; + author: string; + date: string; + url: string; +} type UserEntry = { role: "user"; @@ -17,18 +23,12 @@ type UserEntry = { type AssistantEntry = { role: "assistant"; content: string; + display_content: string; citations: Citation[]; } type Entry = UserEntry | AssistantEntry; -type Citation = { - title: string; - author: string; - date: string; - url: string; -} - // const Colours = ["blue", "cyan", "teal", "green", "amber"].map(colour => `bg-${colour}-100 border-${colour}-300 text-${colour}-800`); // this would be nice, but Tailwind needs te actual string of the class to be in // the source file for it to be included in the build @@ -39,8 +39,8 @@ const Colours = [ "bg-orange-100 border-orange-300 text-orange-800", "bg-lime-100 border-lime-300 text-lime-800", "bg-green-100 border-green-300 text-green-800", - "bg-cyan-100 border-cyan-300 text-cyan-800", - "bg-blue-100 border-blue-300 text-blue-800", + "bg-cyan-100 border-cyan-300 text-cyan-800", + "bg-blue-100 border-blue-300 text-blue-800", ]; const ShowCitation: React.FC<{citation: Citation, i: number}> = ({citation, i}) => { @@ -66,7 +66,7 @@ const ShowEntry: React.FC<{entry: Entry}> = ({entry}) => { return (
{ // split into paragraphs - entry.content.split("\n").map(paragraph => (

{paragraph}

)) + entry.display_content.split("\n").map(paragraph => (

{paragraph}

)) }