/ components / FilePathLink.tsx
FilePathLink.tsx
1 interface Props { 2 filePath: string; 3 gitFileUrlBase?: string | null; 4 className?: string; 5 } 6 7 export function FilePathLink({ filePath, gitFileUrlBase, className }: Props) { 8 if (!gitFileUrlBase) { 9 return <span className={className}>{filePath}</span>; 10 } 11 12 return ( 13 <button 14 type="button" 15 className={`hover:underline hover:text-foreground transition-colors text-left ${className ?? ''}`} 16 onClick={() => void window.electronAPI.openExternal(gitFileUrlBase + filePath)} 17 title={`Open on GitHub`} 18 > 19 {filePath} 20 </button> 21 ); 22 }