File tree Expand file tree Collapse file tree
packages/ui/src/components/editor/panel/ResponsePreview/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 }
1818
1919 code {
20+ font-family : monospace ;
2021 font-size : var (--font-size-11px );
2122 background-color : var (--vscode-textCodeBlock-background );
2223 padding : 2px 4px ;
3435 align-items : center ;
3536 margin : 0 var (--padding-12px );
3637 gap : var (--padding-8px );
38+ font-size : var (--font-size-12px );
39+ color : var (--cwc-text-color-dimmed );
40+ padding-right : var (--padding-9px );
41+
42+ & :hover {
43+ color : var (--cwc-text-color );
44+
45+ & .line {
46+ background-color : var (--cwc-border-color ) !important ;
47+ }
48+ }
3749}
3850
3951.line {
Original file line number Diff line number Diff line change 11import { FC , useRef } from 'react'
22import ReactMarkdown from 'react-markdown'
33import styles from './TextItem.module.scss'
4- import { IconButton } from '../../IconButton'
54
65type Props = {
76 content : string
87 is_expanded : boolean
98 on_toggle : ( element : HTMLDivElement ) => void
109}
1110
12- export const TextItem : FC < Props > = ( { content , is_expanded , on_toggle } ) => {
11+ export const TextItem : FC < Props > = ( props ) => {
1312 const ref = useRef < HTMLDivElement > ( null )
1413
1514 return (
1615 < >
17- { is_expanded ? (
16+ { props . is_expanded ? (
1817 < div
1918 ref = { ref }
2019 className = { styles . text }
21- onClick = { ( ) => ref . current && on_toggle ( ref . current ) }
20+ onClick = { ( ) => ref . current && props . on_toggle ( ref . current ) }
2221 >
23- < ReactMarkdown disallowedElements = { [ 'hr' ] } > { content } </ ReactMarkdown >
22+ < ReactMarkdown disallowedElements = { [ 'hr' ] } >
23+ { props . content }
24+ </ ReactMarkdown >
2425 </ div >
2526 ) : (
2627 < div
2728 ref = { ref }
2829 className = { styles . hidden }
29- onClick = { ( ) => ref . current && on_toggle ( ref . current ) }
30+ onClick = { ( ) => ref . current && props . on_toggle ( ref . current ) }
31+ title = { props . content }
32+ role = "button"
3033 >
3134 < div className = { styles . line } />
32- < IconButton codicon_icon = "list-selection" title = "Show text" />
33- < div className = { styles . line } />
35+ { Math . floor ( props . content . length * 0.25 ) }
3436 </ div >
3537 ) }
3638 </ >
You can’t perform that action at this time.
0 commit comments