Skip to content

Commit b35dce2

Browse files
author
aadamgough
committed
removed carrot
1 parent 23e9ee7 commit b35dce2

File tree

1 file changed

+6
-34
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/components/workflow-preview/components/pinned-sub-blocks

1 file changed

+6
-34
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/workflow-preview/components/pinned-sub-blocks/pinned-sub-blocks.tsx

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,32 @@
11
'use client'
22

33
import { useState } from 'react'
4-
import { ChevronDown, ChevronUp, Maximize2, X, Zap } from 'lucide-react'
4+
import { Maximize2, X, Zap } from 'lucide-react'
55
import { Badge, Button } from '@/components/emcn'
6-
import { cn } from '@/lib/core/utils/cn'
76
import { getBlock } from '@/blocks'
87
import type { BlockConfig, SubBlockConfig } from '@/blocks/types'
98
import type { BlockState } from '@/stores/workflows/workflow/types'
109

1110
function ExpandableValue({ title, value }: { title: string; value: unknown }) {
12-
const [isExpanded, setIsExpanded] = useState(false)
1311
const [isModalOpen, setIsModalOpen] = useState(false)
1412

1513
const displayValue = formatSubBlockValue(value)
1614
const isLargeValue = displayValue.length > 100 || displayValue.includes('\n')
1715

18-
if (!isLargeValue) {
19-
return (
20-
<div className='rounded-[4px] border border-[var(--border)] bg-[var(--surface-3)] p-[10px]'>
21-
<pre className='whitespace-pre-wrap break-words font-mono text-[12px] text-[var(--text-primary)]'>
22-
{displayValue}
23-
</pre>
24-
</div>
25-
)
26-
}
27-
2816
return (
2917
<>
30-
<div>
31-
<div className='mb-[4px] flex items-center justify-end gap-[4px]'>
18+
<div className='relative'>
19+
{isLargeValue && (
3220
<button
3321
onClick={() => setIsModalOpen(true)}
34-
className='rounded-[4px] p-[4px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-3)] hover:text-[var(--text-primary)]'
22+
className='absolute top-[6px] right-[6px] z-10 rounded-[4px] p-[4px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-4)] hover:text-[var(--text-primary)]'
3523
title='Expand in modal'
3624
type='button'
3725
>
3826
<Maximize2 className='h-[12px] w-[12px]' />
3927
</button>
40-
<button
41-
onClick={() => setIsExpanded(!isExpanded)}
42-
className='rounded-[4px] p-[4px] text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-3)] hover:text-[var(--text-primary)]'
43-
type='button'
44-
>
45-
{isExpanded ? (
46-
<ChevronUp className='h-[12px] w-[12px]' />
47-
) : (
48-
<ChevronDown className='h-[12px] w-[12px]' />
49-
)}
50-
</button>
51-
</div>
52-
<div
53-
className={cn(
54-
'overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--surface-3)] p-[10px] font-mono text-[12px] transition-all duration-200',
55-
isExpanded ? 'max-h-64' : 'max-h-20'
56-
)}
57-
>
28+
)}
29+
<div className='max-h-24 overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--surface-3)] p-[10px] font-mono text-[12px]'>
5830
<pre className='whitespace-pre-wrap break-words text-[var(--text-primary)]'>
5931
{displayValue}
6032
</pre>

0 commit comments

Comments
 (0)