Skip to content

Commit

Permalink
avoid using next/image
Browse files Browse the repository at this point in the history
  • Loading branch information
yoziru committed Mar 28, 2024
1 parent 6ba3d07 commit 41fdd92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 47 deletions.
16 changes: 6 additions & 10 deletions src/components/chat/chat-list.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useRef, useEffect } from "react";
import { basePath, cn } from "@/lib/utils";
import { Avatar, AvatarImage } from "../ui/avatar";
import { ChatProps } from "./chat";
import Image from "next/image";
import CodeDisplayBlock from "../code-display-block";

export default function ChatList({
Expand All @@ -28,8 +26,8 @@ export default function ChatList({
return (
<div className="w-full h-full flex justify-center items-center">
<div className="flex flex-col gap-4 items-center">
<Image
src={basePath + "/ollama.png"}
<img
src={basePath + "/ollama.png"}
alt="AI"
width={60}
height={60}
Expand Down Expand Up @@ -70,15 +68,13 @@ export default function ChatList({
)}
{message.role === "assistant" && (
<div className="flex items-end gap-2">
<Avatar className="flex justify-start items-center mt-0 mb-auto">
<AvatarImage
<div className="flex justify-start items-center mt-0 mb-auto relative h-10 w-10 shrink-0 overflow-hidden">
<img
src={basePath + "/ollama.png"}
alt="AI"
width={6}
height={6}
className="object-contain dark:invert"
className="object-contain dark:invert aspect-square h-full w-full"
/>
</Avatar>
</div>
<span className="bg-accent p-3 rounded-md max-w-xs sm:max-w-2xl overflow-x-auto">
{/* Check if the message content contains a code block */}
{message.content.split("```").map((part, index) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { SquarePen, Trash2 } from "lucide-react";
import { basePath, cn } from "@/lib/utils";
import { Button, buttonVariants } from "@/components/ui/button";
import { Message } from "ai/react";
import Image from "next/image";
import { useEffect, useState } from "react";
import SidebarSkeleton from "./sidebar-skeleton";
import Settings from "./settings";
Expand All @@ -21,6 +20,7 @@ import {
import { DialogClose } from "@radix-ui/react-dialog";
import { ChatOptions } from "./chat/chat-options";


interface SidebarProps {
isCollapsed: boolean;
messages: Message[];
Expand Down Expand Up @@ -154,7 +154,7 @@ export function Sidebar({
>
<div className="flex gap-3 items-center">
{!isCollapsed && !isMobile && (
<Image
<img
src={basePath + "/ollama.png"}
alt="AI"
width={28}
Expand Down
35 changes: 0 additions & 35 deletions src/components/ui/avatar.tsx

This file was deleted.

0 comments on commit 41fdd92

Please sign in to comment.