diff --git a/website/src/components/FlaggableElement.tsx b/website/src/components/FlaggableElement.tsx index cae24484..c8fc17ce 100644 --- a/website/src/components/FlaggableElement.tsx +++ b/website/src/components/FlaggableElement.tsx @@ -2,6 +2,7 @@ import { Button, Checkbox, Flex, + Grid, Popover, PopoverAnchor, PopoverArrow, @@ -15,6 +16,7 @@ import { SliderTrack, Spacer, useBoolean, + useId, } from "@chakra-ui/react"; import { FlagIcon, QuestionMarkCircleIcon } from "@heroicons/react/20/solid"; import { useState } from "react"; @@ -65,58 +67,47 @@ export const FlaggableElement = (props) => { isLazy lazyBehavior="keepMounted" > -
+ {props.children} - -
+ - -
- -
    - {TEXT_LABEL_FLAGS.map((option, i) => { - return ( - - ); - })} -
-
- -
-
+
+
+ + {TEXT_LABEL_FLAGS.map((option, i) => ( + + ))} + + + + ); }; -function FlagCheckboxLi(props: { +function FlagCheckbox(props: { option: textFlagLabels; idx: number; checkboxValues: boolean[]; @@ -136,37 +127,35 @@ function FlagCheckboxLi(props: { ); } + const id = useId(); + return ( -
  • - - { - props.checkboxHandler(e.target.checked, props.idx); - }} - /> - - - { - props.sliderHandler(val / 100, props.idx); - }} - > - - - - - - -
  • + + { + props.checkboxHandler(e.target.checked, props.idx); + }} + /> + + + { + props.sliderHandler(val / 100, props.idx); + }} + > + + + + + + ); } interface textFlagLabels { diff --git a/website/src/components/Messages.tsx b/website/src/components/Messages.tsx index cc94fcc0..5b77cd26 100644 --- a/website/src/components/Messages.tsx +++ b/website/src/components/Messages.tsx @@ -1,3 +1,4 @@ +import { Grid } from "@chakra-ui/react"; import { FlaggableElement } from "./FlaggableElement"; export interface Message { @@ -10,18 +11,13 @@ const getColor = (isAssistant: boolean) => (isAssistant ? "bg-slate-800" : "bg-s export const Messages = ({ messages, post_id }: { messages: Message[]; post_id: string }) => { const items = messages.map(({ text, is_assistant }: Message, i: number) => { return ( -
    - -
    - {text} -
    -
    -
    + +
    + {text} +
    +
    ); }); // Maybe also show a legend of the colors? - return <>{items}; + return {items}; };