moved components into new folder

This commit is contained in:
jojopirker
2023-01-04 15:38:26 +01:00
parent b08e1b986a
commit be22c77b07
3 changed files with 49 additions and 53 deletions
@@ -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>
);
};