fix: review comments and frontend build issue in label_initial_prompt.tsx due to previous message_id changes

This commit is contained in:
James Melvin
2023-01-08 11:19:01 +05:30
parent d4fdaeca81
commit e39602cf7c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ export interface Message {
export const Messages = ({ messages, post_id }: { messages: Message[]; post_id: string }) => {
const items = messages.map((messageProps: Message, i: number) => {
const { text } = messageProps;
const { message_id } = messageProps;
const { text } = messageProps;
return (
<FlaggableElement text={text} post_id={post_id} message_id={message_id} key={i + text}>
<MessageView {...messageProps} />
@@ -24,7 +24,7 @@ export const Messages = ({ messages, post_id }: { messages: Message[]; post_id:
return <Grid gap={2}>{items}</Grid>;
};
export const MessageView = ({ is_assistant, text }: Message) => {
export const MessageView = ({ is_assistant, text, message_id }: Message) => {
const { colorMode } = useColorMode();
const bgColor = useMemo(() => {
@@ -43,7 +43,7 @@ const LabelInitialPrompt = () => {
<>
<h5 className="text-lg font-semibold">Label Initial Prompt</h5>
<p className="text-lg py-1">Provide labels for the following prompt</p>
<MessageView text={task.prompt} is_assistant />
<MessageView text={task.prompt} is_assistant message_id={task.message_id} />
</>
<CheckboxSliderGroup labelIDs={task.valid_labels} onChange={setSliderValues} />
</TwoColumnsWithCards>