import { useNavigate } from 'react-router-dom'; import type { SequenceSummary } from '../lib/api'; import { cleanFunction, fmtInt, methodShort, sequencePath, year } from '../lib/format'; import { MiniSplit } from './charts'; export type SortKey = 'sequence' | 'length' | 'observations' | 'states' | 'entries' | 'released'; function Th({ k, label, sort, order, onSort, num, }: { k: SortKey; label: string; sort?: SortKey; order?: 'asc' | 'desc'; onSort?: (k: SortKey) => void; num?: boolean; }) { const active = sort === k; if (!onSort) return
| Function | Apo / holo | Methods | ||||||
|---|---|---|---|---|---|---|---|---|
|
{
e.preventDefault();
navigate(sequencePath(s.sequence_id));
}}
>
{s.sequence_id}
{s.uniprot_id ?? 'no UniProt'}
|
{s.top_function ? cleanFunction(s.top_function) : '—'} | {fmtInt(s.length)} | {fmtInt(s.n_obs)} | {fmtInt(s.n_states)} | {fmtInt(s.n_entries)} |
|
{s.methods.slice(0, 2).map(methodShort).join(', ')} | {year(s.last_release)} |