import { Check, Copy, FileCode } from 'lucide-react' import Block from '../Primitives/Block/Block' import Button from '../Button/Button' import { ButtonSize, ButtonSubType, ButtonType } from '../Button/types' import type { CodeBlockTokenType } from '../CodeBlock/codeBlock.token' import type { ReactNode } from 'react' type CodeEditorHeaderProps = { header: string headerLeftSlot?: ReactNode headerRightSlot?: ReactNode showLeftIcon: boolean showCopyButton: boolean isCopied: boolean onCopy: () => void tokens: CodeBlockTokenType } export const CodeEditorHeader = ({ header, headerLeftSlot, headerRightSlot, showLeftIcon, showCopyButton, isCopied, onCopy, tokens, }: CodeEditorHeaderProps) => { const headerPaddingX = typeof tokens.header.padding.x === 'number' ? `${tokens.header.padding.x}px` : tokens.header.padding.x const headerPaddingY = typeof tokens.header.padding.y === 'number' ? `${tokens.header.padding.y}px` : tokens.header.padding.y const headerGap = typeof tokens.header.gap === 'number' ? `${tokens.header.gap}px` : tokens.header.gap const iconSize = typeof tokens.header.icon.width === 'number' ? tokens.header.icon.width : parseInt(String(tokens.header.icon.width || '16')) return ( {headerLeftSlot ? ( headerLeftSlot ) : showLeftIcon ? ( ) : null} {header} {headerRightSlot && ( {headerRightSlot} )} {showCopyButton && ( ) => { e.currentTarget.style.opacity = '1' }} onMouseLeave={(e: React.MouseEvent) => { e.currentTarget.style.opacity = '0.7' }} >