Skip to content

Commit bb0128b

Browse files
committed
Reworked the Log detail panel
1 parent 34aae18 commit bb0128b

File tree

5 files changed

+124
-540
lines changed

5 files changed

+124
-540
lines changed

apps/webapp/app/components/code/CodeBlock.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ type CodeBlockProps = {
6868

6969
/** Search term to highlight in the code */
7070
searchTerm?: string;
71+
72+
/** Whether to wrap the code */
73+
wrap?: boolean;
7174
};
7275

7376
const dimAmount = 0.5;
@@ -207,6 +210,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
207210
fileName,
208211
rowTitle,
209212
searchTerm,
213+
wrap = false,
210214
...props
211215
}: CodeBlockProps,
212216
ref
@@ -215,7 +219,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
215219
const [copied, setCopied] = useState(false);
216220
const [modalCopied, setModalCopied] = useState(false);
217221
const [isModalOpen, setIsModalOpen] = useState(false);
218-
const [isWrapped, setIsWrapped] = useState(false);
222+
const [isWrapped, setIsWrapped] = useState(wrap);
219223

220224
const onCopied = useCallback(
221225
(event: React.MouseEvent<HTMLButtonElement>) => {

0 commit comments

Comments
 (0)