summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components/UserInputContainer.tsx
blob: 28437d35d39dbfd73bcc95f53e7b1b4a8d9c7327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from "react";
import ReactMarkdown from "react-markdown";
import styled from "styled-components";
import { buttonColor, secondaryDark } from ".";
import HeaderButtonWithText from "./HeaderButtonWithText";
import { Play, XMark } from "@styled-icons/heroicons-outline";
import { RootStore } from "../redux/store";
import { useSelector } from "react-redux";
import { HistoryNode } from "../../../schema/HistoryNode";

interface UserInputContainerProps {
  onDelete: () => void;
  children: string;
  historyNode: HistoryNode;
}

const StyledDiv = styled.div`
  background-color: rgb(45 45 45);
  padding: 8px;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid white;
  border-top: 1px solid white;
  font-size: 13px;
  display: flex;
  align-items: center;
`;

const UserInputContainer = (props: UserInputContainerProps) => {
  return (
    <StyledDiv>
      <b>{props.children}</b>
      <div style={{ marginLeft: "auto" }}>
        <HeaderButtonWithText
          onClick={(e) => {
            props.onDelete();
            e.stopPropagation();
          }}
          text="Delete"
        >
          <XMark size="1.6em" />
        </HeaderButtonWithText>
      </div>
    </StyledDiv>
  );
};

export default UserInputContainer;