import React from 'react'
import _ from 'lodash'
import { formatTimeStamp, formatTimeDelta } from '../../utils.js'
export function TimeStamp({ t, deltaTo, title }) {
    return t ? (
        
            | {title}: | {formatTimeStamp(t)}
                {deltaTo && (
                    
                        ({formatTimeDelta(1000 * (t - deltaTo))})
                    
                )} | 
    ) : (
        |
    )
}
export function ConnectionInfo({ conn }) {
    return (
        
            
                
                    | Address: | {conn.address.address.join(':')} | 
                {conn.sni && (
                    
                        | TLS SNI: | {conn.sni} | 
                )}
            
        
    )
}
export function CertificateInfo({ flow }) {
    // @todo We should fetch human-readable certificate representation from the server
    return (
        
            {flow.client_conn.cert && [
                
Client Certificate
,
                
{flow.client_conn.cert}
            ]}
            {flow.server_conn.cert && [
                
Server Certificate
,
                
{flow.server_conn.cert}
            ]}
        
            Timing
            
                
                    {timestamps.filter(v => v).sort((a, b) => a.t - b.t).map(item => (
                        
                    ))}
                
            
         
    )
}
export default function Details({ flow }) {
    return (
        
            Client Connection
            
            Server Connection
            
            
            
        
    )
}