From 359c277f25c323d3fd47830d569fb05f93920d3a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 1 Jul 2023 12:36:57 -0700 Subject: explicit context pill buttons --- .../src/components/IterationContainer.tsx | 77 ---------------------- 1 file changed, 77 deletions(-) delete mode 100644 extension/react-app/src/components/IterationContainer.tsx (limited to 'extension/react-app/src/components/IterationContainer.tsx') diff --git a/extension/react-app/src/components/IterationContainer.tsx b/extension/react-app/src/components/IterationContainer.tsx deleted file mode 100644 index a0053519..00000000 --- a/extension/react-app/src/components/IterationContainer.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { useState } from "react"; -import styled from "styled-components"; -import { - defaultBorderRadius, - MainContainerWithBorder, - secondaryDark, - vscBackground, -} from "."; -import { RangeInFile, FileEdit } from "../../../src/client"; -import CodeBlock from "./CodeBlock"; -import SubContainer from "./SubContainer"; - -import { ChevronDown, ChevronRight } from "@styled-icons/heroicons-outline"; - -export interface IterationContext { - codeSelections: RangeInFile[]; - instruction: string; - suggestedChanges: FileEdit[]; - status: "waiting" | "accepted" | "rejected"; - summary?: string; - action: string; - error?: string; -} - -interface IterationContainerProps { - iterationContext: IterationContext; -} - -const IterationContainerDiv = styled.div<{ open: boolean }>` - background-color: ${(props) => (props.open ? vscBackground : secondaryDark)}; - border-radius: ${defaultBorderRadius}; - padding: ${(props) => (props.open ? "2px" : "8px")}; -`; - -function IterationContainer(props: IterationContainerProps) { - const [open, setOpen] = useState(false); - - return ( - - -

setOpen((prev) => !prev)} - > - {open ? : } - {props.iterationContext.summary || - props.iterationContext.codeSelections - .map((cs) => cs.filepath) - .join("\n")} -

- - {open && ( - <> - - {props.iterationContext.action} - - {props.iterationContext.error && ( - - {props.iterationContext.error} - - )} - {props.iterationContext.suggestedChanges.map((sc) => { - return ( - - {sc.filepath} - {sc.replacement} - - ); - })} - - )} -
-
- ); -} - -export default IterationContainer; -- cgit v1.2.3-70-g09d2