import {Fragment} from 'react'; import {Link} from 'react-router'; import GridEditable, { COL_WIDTH_UNDEFINED, GridColumnHeader, GridColumnOrder, } from 'sentry/components/gridEditable'; import Pagination from 'sentry/components/pagination'; import {useLocation} from 'sentry/utils/useLocation'; import {useInteractionQuery} from 'sentry/views/performance/browser/interactionSummary/useInteractionQuery'; import {DurationCell} from 'sentry/views/starfish/components/tableCells/durationCell'; import {renderHeadCell} from 'sentry/views/starfish/components/tableCells/renderHeadCell'; type Row = { eventId: string; project: string; 'transaction.duration': number; }; type Column = GridColumnHeader; function InteractionSampleTable() { const location = useLocation(); const columnOrder: GridColumnOrder[] = [ {key: 'eventId', width: COL_WIDTH_UNDEFINED, name: 'event'}, {key: 'transaction.duration', width: COL_WIDTH_UNDEFINED, name: 'duration'}, ]; const {data, isLoading, pageLinks} = useInteractionQuery(); const tableData: Row[] = data.length ? data : []; const renderBodyCell = (col: Column, row: Row) => { const {key} = col; if (key === 'transaction.duration') { return ; } if (key === 'eventId') { return ( {row.eventId.slice(0, 8)} ); } return {row[key]}; }; return ( renderHeadCell({ column, location, }), renderBodyCell, }} location={location} /> ); } export default InteractionSampleTable;