mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(blocks): give the detail headers the same tile as everything else (#6672)
The tile consolidation left the large detail headers on their own treatment, so a block wore one colour on the canvas and another in the header naming it: the preview panel behind the deploy modal and the logs trace detail both painted straight from the catalog `bgColor`, showing Start's catalog blue over a neutral card, and hardcoded `#2FB3FF`/`#FEE12B` for the two subflows. Adds the 18px header slot to `BlockTile` and points all three headers at it — preview panel, trace detail, and the editor header, which had been carrying its own inline copy of the accent rule. `WorkflowTypeIcon` takes an icon class so the accent chip can draw the larger glyph the header uses.
This commit is contained in:
@@ -183,10 +183,18 @@ export const getWorkflowTypeAccent = (type: string) =>
|
||||
export interface WorkflowTypeIconProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
||||
type: string
|
||||
Icon: ComponentType<{ className?: string }>
|
||||
/** Overrides the glyph size when the chip is rendered at a non-default slot. */
|
||||
iconClassName?: string
|
||||
}
|
||||
|
||||
/** Shared compact core-block icon used by workflow discovery surfaces. */
|
||||
export function WorkflowTypeIcon({ type, Icon, className, ...props }: WorkflowTypeIconProps) {
|
||||
export function WorkflowTypeIcon({
|
||||
type,
|
||||
Icon,
|
||||
className,
|
||||
iconClassName,
|
||||
...props
|
||||
}: WorkflowTypeIconProps) {
|
||||
const typeAccent = getWorkflowTypeAccent(type)
|
||||
|
||||
return (
|
||||
@@ -197,7 +205,12 @@ export function WorkflowTypeIcon({ type, Icon, className, ...props }: WorkflowTy
|
||||
data-workflow-type-icon={type}
|
||||
{...props}
|
||||
>
|
||||
<Icon className='size-[10px] transition-transform duration-100 group-hover:scale-110' />
|
||||
<Icon
|
||||
className={cn(
|
||||
'size-[10px] transition-transform duration-100 group-hover:scale-110',
|
||||
iconClassName
|
||||
)}
|
||||
/>
|
||||
</ChipTag>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user