From 58ddc72cbb797075fb850c795cf45d1d353aac71 Mon Sep 17 00:00:00 2001 From: David Corbitt Date: Thu, 20 Jul 2023 22:36:21 -0700 Subject: [PATCH] Make CompareFunctions more configurable --- .../RefinePromptModal/CompareFunctions.tsx | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/components/RefinePromptModal/CompareFunctions.tsx b/src/components/RefinePromptModal/CompareFunctions.tsx index fee9736..e6a3d69 100644 --- a/src/components/RefinePromptModal/CompareFunctions.tsx +++ b/src/components/RefinePromptModal/CompareFunctions.tsx @@ -1,4 +1,4 @@ -import { HStack, VStack, useBreakpointValue } from "@chakra-ui/react"; +import { type StackProps, VStack, useBreakpointValue } from "@chakra-ui/react"; import React from "react"; import DiffViewer, { DiffMethod } from "react-diff-viewer"; import Prism from "prismjs"; @@ -19,10 +19,15 @@ const highlightSyntax = (str: string) => { const CompareFunctions = ({ originalFunction, newFunction = "", + leftTitle = "Original", + rightTitle = "Modified", + ...props }: { originalFunction: string; newFunction?: string; -}) => { + leftTitle?: string; + rightTitle?: string; +} & StackProps) => { const showSplitView = useBreakpointValue( { base: false, @@ -34,22 +39,20 @@ const CompareFunctions = ({ ); return ( - - - - - + + + ); };