summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-09-04 11:01:37 -0700
committerNate Sesti <sestinj@gmail.com>2023-09-04 11:01:37 -0700
commit45d9bab5cea745573be7112d7130089c596c88fa (patch)
tree0d8cfd11432ab929578f90eafd041cd80935250d /extension/react-app/src/components
parentb632a5ab537069e22b976b097b34b9879be18168 (diff)
downloadsncontinue-45d9bab5cea745573be7112d7130089c596c88fa.tar.gz
sncontinue-45d9bab5cea745573be7112d7130089c596c88fa.tar.bz2
sncontinue-45d9bab5cea745573be7112d7130089c596c88fa.zip
fix: :bug: traceback fixes, remove replicate from hiddenimports
Diffstat (limited to 'extension/react-app/src/components')
-rw-r--r--extension/react-app/src/components/UserInputContainer.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/extension/react-app/src/components/UserInputContainer.tsx b/extension/react-app/src/components/UserInputContainer.tsx
index fe85c431..228c3530 100644
--- a/extension/react-app/src/components/UserInputContainer.tsx
+++ b/extension/react-app/src/components/UserInputContainer.tsx
@@ -69,6 +69,13 @@ const TextArea = styled.textarea`
}
`;
+function stringWithEllipsis(str: string, maxLen: number) {
+ if (str.length > maxLen) {
+ return str.substring(0, maxLen - 3) + "...\n(Click to expand)";
+ }
+ return str;
+}
+
const UserInputContainer = (props: UserInputContainerProps) => {
const [isHovered, setIsHovered] = useState(false);
const [isEditing, setIsEditing] = useState(false);
@@ -144,7 +151,7 @@ const UserInputContainer = (props: UserInputContainerProps) => {
}}
className="mr-6 cursor-text w-full"
>
- {props.children}
+ {stringWithEllipsis(props.children, 600)}
</StyledPre>
)}
{/* <ReactMarkdown children={props.children} className="w-fit mr-10" /> */}