Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

805 B
Raw Blame
// Tasteful colored file-type glyphs (pdf red, docx blue, xlsx green, pptx orange, …) via
// react-file-icon, the standard library for this. One wrapper used by file cards + preview.
'use client';
import React from 'react';
import { FileIcon, defaultStyles } from 'react-file-icon';

export function extOf(name: string): string {
  const m = (name || '').toLowerCase().match(/\.([a-z0-9]+)$/);
  return m ? m[1] : '';
}

export function FileTypeIcon({ name, size = 36 }: { name: string; size?: number }) {
  const ext = extOf(name);
  const style = (defaultStyles as Record<string, object>)[ext] || {};
  return (
    <span style={{ width: size, height: Math.round(size * 1.16), display: 'inline-block', flex: '0 0 auto' }}>
      <FileIcon extension={ext || undefined} {...style} />
    </span>
  );
}