(props: {
cell: CodeCellType;
runCell: () => void;
onDeleteCell: ((cell: CellType) => void) | null;
cellMode: CellModeType;
setCellMode: (mode: CellModeType) => void;
updateFilename: (filename: string) => void;
filenameError: string | null;
setFilenameError: (error: string | null) => void;
fullscreen: boolean;
setFullscreen: (open: boolean) => void;
setShowStdio: (open: boolean) => void;
generate: () => void;
prompt: string;
setPrompt: (prompt: string) => void;
stopCell: () => void;
onAccept: () => void;
onRevert: () => void;
formatCell: () => void;
aiEnabled: boolean;
})
| 268 | } |
| 269 | |
| 270 | function Header(props: { |
| 271 | cell: CodeCellType; |
| 272 | runCell: () => void; |
| 273 | onDeleteCell: ((cell: CellType) => void) | null; |
| 274 | cellMode: CellModeType; |
| 275 | setCellMode: (mode: CellModeType) => void; |
| 276 | updateFilename: (filename: string) => void; |
| 277 | filenameError: string | null; |
| 278 | setFilenameError: (error: string | null) => void; |
| 279 | fullscreen: boolean; |
| 280 | setFullscreen: (open: boolean) => void; |
| 281 | setShowStdio: (open: boolean) => void; |
| 282 | generate: () => void; |
| 283 | prompt: string; |
| 284 | setPrompt: (prompt: string) => void; |
| 285 | stopCell: () => void; |
| 286 | onAccept: () => void; |
| 287 | onRevert: () => void; |
| 288 | formatCell: () => void; |
| 289 | aiEnabled: boolean; |
| 290 | }) { |
| 291 | const { |
| 292 | cell, |
| 293 | runCell, |
| 294 | onDeleteCell, |
| 295 | cellMode, |
| 296 | setCellMode, |
| 297 | updateFilename, |
| 298 | filenameError, |
| 299 | setFilenameError, |
| 300 | fullscreen, |
| 301 | setFullscreen, |
| 302 | setShowStdio, |
| 303 | generate, |
| 304 | prompt, |
| 305 | setPrompt, |
| 306 | stopCell, |
| 307 | formatCell, |
| 308 | aiEnabled, |
| 309 | } = props; |
| 310 | |
| 311 | const navigate = useNavigate(); |
| 312 | |
| 313 | return ( |
| 314 | <> |
| 315 | <div className="p-1 flex items-center justify-between gap-2"> |
| 316 | <div className={cn('flex items-center gap-1', cellMode !== 'off' && 'opacity-50')}> |
| 317 | <FilenameInput |
| 318 | filename={cell.filename} |
| 319 | onUpdate={updateFilename} |
| 320 | onChange={() => setFilenameError(null)} |
| 321 | className={cn( |
| 322 | 'w-[200px] font-mono font-semibold text-xs transition-colors px-2', |
| 323 | filenameError |
| 324 | ? 'border-error' |
| 325 | : 'border-transparent hover:border-input group-hover:border-input ', |
| 326 | )} |
| 327 | /> |
nothing calls this directly
no test coverage detected