mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
Ensure FlaggableElement always has the set of labels
This commit is contained in:
@@ -2,6 +2,7 @@ import { Avatar, HStack, LinkBox, useColorModeValue } from "@chakra-ui/react";
|
||||
import { boolean } from "boolean";
|
||||
import NextLink from "next/link";
|
||||
import { FlaggableElement } from "src/components/FlaggableElement";
|
||||
import type { ValidLabel } from "src/components/Messages";
|
||||
|
||||
interface Message {
|
||||
text: string;
|
||||
@@ -11,13 +12,14 @@ interface Message {
|
||||
interface MessageTableEntryProps {
|
||||
item: Message;
|
||||
idx: number;
|
||||
valid_labels: ValidLabel[];
|
||||
}
|
||||
export function MessageTableEntry(props: MessageTableEntryProps) {
|
||||
const { item, idx } = props;
|
||||
const { item, idx, valid_labels } = props;
|
||||
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}`}>
|
||||
<FlaggableElement text={item.text} post_id={item.id} key={`flag_${item.id}`} flaggable_labels={valid_labels}>
|
||||
<HStack>
|
||||
<Avatar
|
||||
name={`${boolean(item.is_assistant) ? "Assitant" : "User"}`}
|
||||
|
||||
Reference in New Issue
Block a user