mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-10 11:41:04 +08:00
moved components into new folder
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Avatar, Box, HStack, useColorModeValue } from "@chakra-ui/react";
|
||||
|
||||
import { FlaggableElement } from "../FlaggableElement";
|
||||
|
||||
export function MessageTableEntry ({ item, idx }) {
|
||||
const bgColor = useColorModeValue(idx % 2 === 0 ? "bg-slate-800" : "bg-black", "bg-sky-900");
|
||||
|
||||
return (
|
||||
<FlaggableElement text={item.text} post_id={item.id} key={`flag_${item.id}`}>
|
||||
<HStack>
|
||||
<Avatar
|
||||
name={`${item.isAssistant ? "Assitant" : "User"}`}
|
||||
src={`${item.isAssistant ? "/logos/logo.png" : "/images/temp-avatars/av1.jpg"}`}
|
||||
/>
|
||||
<Box className={`p-4 rounded-md text-white whitespace-pre-wrap ${bgColor} text-white w-full`}>{item.text}</Box>
|
||||
</HStack>
|
||||
</FlaggableElement>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user