light/dark code highlight

This commit is contained in:
Mckay Wrigley
2023-03-18 02:32:30 -06:00
parent f56501ba7c
commit b6d5576227
4 changed files with 16 additions and 8 deletions
+6 -2
View File
@@ -9,11 +9,12 @@ interface Props {
model: OpenAIModel;
messages: Message[];
loading: boolean;
lightMode: "light" | "dark";
onSend: (message: Message) => void;
onSelect: (model: OpenAIModel) => void;
}
export const Chat: FC<Props> = ({ model, messages, loading, onSend, onSelect }) => {
export const Chat: FC<Props> = ({ model, messages, loading, lightMode, onSend, onSelect }) => {
const messagesEndRef = useRef<HTMLDivElement>(null);
const scrollToBottom = () => {
@@ -44,7 +45,10 @@ export const Chat: FC<Props> = ({ model, messages, loading, onSend, onSelect })
{messages.map((message, index) => (
<div key={index}>
<ChatMessage message={message} />
<ChatMessage
message={message}
lightMode={lightMode}
/>
</div>
))}
{loading && <ChatLoader />}