Skip to content

Commit ac5e6bc

Browse files
[getsentry/action-github-commit] Auto commit
1 parent baf2a21 commit ac5e6bc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/components/expandable/index.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use client';
22

3-
import { ReactNode, useCallback, useEffect, useRef, useState } from 'react';
4-
import { ChevronDownIcon, ChevronRightIcon } from '@radix-ui/react-icons';
3+
import {ReactNode, useCallback, useEffect, useRef, useState} from 'react';
4+
import {ChevronDownIcon, ChevronRightIcon} from '@radix-ui/react-icons';
55
import * as Sentry from '@sentry/nextjs';
66

7-
import { usePlausibleEvent } from 'sentry-docs/hooks/usePlausibleEvent';
7+
import {usePlausibleEvent} from 'sentry-docs/hooks/usePlausibleEvent';
88

99
// explicitly not usig CSS modules here
1010
// because there's some prerendered content that depends on these exact class names
@@ -41,12 +41,12 @@ export function Expandable({
4141
const [isExpanded, setIsExpanded] = useState(false);
4242
const [copied, setCopied] = useState(false);
4343
const contentRef = useRef<HTMLDivElement>(null);
44-
const { emit } = usePlausibleEvent();
44+
const {emit} = usePlausibleEvent();
4545

4646
// Ensure we scroll to the element if the URL hash matches
4747
useEffect(() => {
4848
if (!id) {
49-
return () => { };
49+
return () => {};
5050
}
5151

5252
if (window.location.hash === `#${id}`) {
@@ -78,7 +78,7 @@ export function Expandable({
7878
return;
7979
}
8080

81-
emit('Copy Expandable Content', { props: { page: window.location.pathname, title } });
81+
emit('Copy Expandable Content', {props: {page: window.location.pathname, title}});
8282

8383
// First, try to get text from main code blocks (those inside pre elements)
8484
const preCodeBlocks = contentRef.current.querySelectorAll('pre code');
@@ -95,7 +95,8 @@ export function Expandable({
9595
const allCodeBlocks = contentRef.current.querySelectorAll('code');
9696
const largeCodeBlocks = Array.from(allCodeBlocks).filter((block: Element) => {
9797
// Skip inline code (usually short and inside paragraphs)
98-
const isInlineCode = block.closest('p') !== null && (block.textContent?.length || 0) < 100;
98+
const isInlineCode =
99+
block.closest('p') !== null && (block.textContent?.length || 0) < 100;
99100
return !isInlineCode;
100101
});
101102

@@ -135,7 +136,7 @@ export function Expandable({
135136
setIsExpanded(newVal);
136137

137138
if (newVal) {
138-
emit('Open Expandable', { props: { page: window.location.pathname, title } });
139+
emit('Open Expandable', {props: {page: window.location.pathname, title}});
139140
}
140141

141142
if (id) {

0 commit comments

Comments
 (0)