tableView.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import * as Sentry from '@sentry/react';
  4. import type {Location, LocationDescriptorObject} from 'history';
  5. import {openModal} from 'sentry/actionCreators/modal';
  6. import GridEditable, {
  7. COL_WIDTH_MINIMUM,
  8. COL_WIDTH_UNDEFINED,
  9. } from 'sentry/components/gridEditable';
  10. import SortLink from 'sentry/components/gridEditable/sortLink';
  11. import Link from 'sentry/components/links/link';
  12. import {Tooltip} from 'sentry/components/tooltip';
  13. import Truncate from 'sentry/components/truncate';
  14. import {IconStack} from 'sentry/icons';
  15. import {t} from 'sentry/locale';
  16. import type {Organization} from 'sentry/types/organization';
  17. import {trackAnalytics} from 'sentry/utils/analytics';
  18. import {browserHistory} from 'sentry/utils/browserHistory';
  19. import type {CustomMeasurementCollection} from 'sentry/utils/customMeasurements/customMeasurements';
  20. import {getTimeStampFromTableDateField} from 'sentry/utils/dates';
  21. import type {TableData, TableDataRow} from 'sentry/utils/discover/discoverQuery';
  22. import type EventView from 'sentry/utils/discover/eventView';
  23. import {
  24. isFieldSortable,
  25. pickRelevantLocationQueryStrings,
  26. } from 'sentry/utils/discover/eventView';
  27. import {
  28. DURATION_UNITS,
  29. getFieldRenderer,
  30. SIZE_UNITS,
  31. } from 'sentry/utils/discover/fieldRenderers';
  32. import type {Column} from 'sentry/utils/discover/fields';
  33. import {
  34. fieldAlignment,
  35. getEquationAliasIndex,
  36. isEquationAlias,
  37. } from 'sentry/utils/discover/fields';
  38. import {
  39. type DiscoverDatasets,
  40. DisplayModes,
  41. type SavedQueryDatasets,
  42. TOP_N,
  43. } from 'sentry/utils/discover/types';
  44. import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
  45. import ViewReplayLink from 'sentry/utils/discover/viewReplayLink';
  46. import {getShortEventId} from 'sentry/utils/events';
  47. import {generateProfileFlamechartRoute} from 'sentry/utils/profiling/routes';
  48. import {decodeList} from 'sentry/utils/queryString';
  49. import {MutableSearch} from 'sentry/utils/tokenizeSearch';
  50. import normalizeUrl from 'sentry/utils/url/normalizeUrl';
  51. import useProjects from 'sentry/utils/useProjects';
  52. import {useRoutes} from 'sentry/utils/useRoutes';
  53. import {hasDatasetSelector} from 'sentry/views/dashboards/utils';
  54. import {TraceViewSources} from 'sentry/views/performance/newTraceDetails/traceMetadataHeader';
  55. import {getTraceDetailsUrl} from 'sentry/views/performance/traceDetails/utils';
  56. import {generateReplayLink} from 'sentry/views/performance/transactionSummary/utils';
  57. import {
  58. getExpandedResults,
  59. getTargetForTransactionSummaryLink,
  60. pushEventViewToLocation,
  61. } from '../utils';
  62. import {QuickContextHoverWrapper} from './quickContext/quickContextWrapper';
  63. import {ContextType} from './quickContext/utils';
  64. import CellAction, {Actions, updateQuery} from './cellAction';
  65. import ColumnEditModal, {modalCss} from './columnEditModal';
  66. import TableActions from './tableActions';
  67. import TopResultsIndicator from './topResultsIndicator';
  68. import type {TableColumn} from './types';
  69. export type TableViewProps = {
  70. error: string | null;
  71. eventView: EventView;
  72. isFirstPage: boolean;
  73. isLoading: boolean;
  74. location: Location;
  75. measurementKeys: null | string[];
  76. onChangeShowTags: () => void;
  77. organization: Organization;
  78. showTags: boolean;
  79. tableData: TableData | null | undefined;
  80. title: string;
  81. customMeasurements?: CustomMeasurementCollection;
  82. dataset?: DiscoverDatasets;
  83. isHomepage?: boolean;
  84. queryDataset?: SavedQueryDatasets;
  85. spanOperationBreakdownKeys?: string[];
  86. };
  87. /**
  88. * The `TableView` is marked with leading _ in its method names. It consumes
  89. * the EventView object given in its props to generate new EventView objects
  90. * for actions like resizing column.
  91. *
  92. * The entire state of the table view (or event view) is co-located within
  93. * the EventView object. This object is fed from the props.
  94. *
  95. * Attempting to modify the state, and therefore, modifying the given EventView
  96. * object given from its props, will generate new instances of EventView objects.
  97. *
  98. * In most cases, the new EventView object differs from the previous EventView
  99. * object. The new EventView object is pushed to the location object.
  100. */
  101. function TableView(props: TableViewProps) {
  102. const {projects} = useProjects();
  103. const routes = useRoutes();
  104. const replayLinkGenerator = generateReplayLink(routes);
  105. /**
  106. * Updates a column on resizing
  107. */
  108. function _resizeColumn(
  109. columnIndex: number,
  110. nextColumn: TableColumn<keyof TableDataRow>
  111. ) {
  112. const {location, eventView} = props;
  113. const newWidth = nextColumn.width ? Number(nextColumn.width) : COL_WIDTH_UNDEFINED;
  114. const nextEventView = eventView.withResizedColumn(columnIndex, newWidth);
  115. pushEventViewToLocation({
  116. location,
  117. nextEventView,
  118. extraQuery: pickRelevantLocationQueryStrings(location),
  119. });
  120. }
  121. function _renderPrependColumns(
  122. isHeader: boolean,
  123. dataRow?: any,
  124. rowIndex?: number
  125. ): React.ReactNode[] {
  126. const {organization, eventView, tableData, location, isHomepage} = props;
  127. const hasAggregates = eventView.hasAggregateField();
  128. const hasIdField = eventView.hasIdField();
  129. if (isHeader) {
  130. if (hasAggregates) {
  131. return [
  132. <PrependHeader key="header-icon">
  133. <IconStack size="sm" />
  134. </PrependHeader>,
  135. ];
  136. }
  137. if (!hasIdField) {
  138. return [
  139. <PrependHeader key="header-event-id">
  140. <SortLink
  141. align="left"
  142. title={t('event id')}
  143. direction={undefined}
  144. canSort={false}
  145. generateSortLink={() => undefined}
  146. />
  147. </PrependHeader>,
  148. ];
  149. }
  150. return [];
  151. }
  152. if (hasAggregates) {
  153. const nextView = getExpandedResults(eventView, {}, dataRow);
  154. const target = {
  155. pathname: location.pathname,
  156. query: nextView.generateQueryStringObject(),
  157. };
  158. return [
  159. <Tooltip key={`eventlink${rowIndex}`} title={t('Open Group')}>
  160. <Link
  161. to={target}
  162. data-test-id="open-group"
  163. onClick={() => {
  164. if (nextView.isEqualTo(eventView)) {
  165. Sentry.captureException(new Error('Failed to drilldown'));
  166. }
  167. }}
  168. >
  169. <StyledIcon size="sm" />
  170. </Link>
  171. </Tooltip>,
  172. ];
  173. }
  174. if (!hasIdField) {
  175. let value = dataRow.id;
  176. if (tableData?.meta) {
  177. const fieldRenderer = getFieldRenderer('id', tableData.meta);
  178. value = fieldRenderer(dataRow, {organization, location});
  179. }
  180. let target;
  181. if (dataRow['event.type'] !== 'transaction') {
  182. const project = dataRow.project || dataRow['project.name'];
  183. target = {
  184. // NOTE: This uses a legacy redirect for project event to the issue group event link
  185. // This only works with dev-server or production.
  186. pathname: normalizeUrl(
  187. `/${organization.slug}/${project}/events/${dataRow.id}/`
  188. ),
  189. query: {...location.query, referrer: 'discover-events-table'},
  190. };
  191. } else {
  192. if (!dataRow.trace) {
  193. throw new Error(
  194. 'Transaction event should always have a trace associated with it.'
  195. );
  196. }
  197. target = generateLinkToEventInTraceView({
  198. traceSlug: dataRow.trace,
  199. eventId: dataRow.id,
  200. projectSlug: dataRow.project || dataRow['project.name'],
  201. timestamp: dataRow.timestamp,
  202. organization,
  203. isHomepage,
  204. location,
  205. eventView,
  206. type: 'discover',
  207. source: TraceViewSources.DISCOVER,
  208. });
  209. }
  210. const eventIdLink = (
  211. <StyledLink data-test-id="view-event" to={target}>
  212. {value}
  213. </StyledLink>
  214. );
  215. return [
  216. <QuickContextHoverWrapper
  217. key={`quickContextEventHover${rowIndex}`}
  218. dataRow={dataRow}
  219. contextType={ContextType.EVENT}
  220. organization={organization}
  221. projects={projects}
  222. eventView={eventView}
  223. >
  224. {eventIdLink}
  225. </QuickContextHoverWrapper>,
  226. ];
  227. }
  228. return [];
  229. }
  230. function _renderGridHeaderCell(
  231. column: TableColumn<keyof TableDataRow>
  232. ): React.ReactNode {
  233. const {eventView, location, tableData} = props;
  234. const tableMeta = tableData?.meta;
  235. const align = fieldAlignment(column.name, column.type, tableMeta);
  236. const field = {field: column.key as string, width: column.width};
  237. function generateSortLink(): LocationDescriptorObject | undefined {
  238. if (!tableMeta) {
  239. return undefined;
  240. }
  241. const nextEventView = eventView.sortOnField(field, tableMeta);
  242. const queryStringObject = nextEventView.generateQueryStringObject();
  243. // Need to pull yAxis from location since eventView only stores 1 yAxis field at time
  244. queryStringObject.yAxis = decodeList(location.query.yAxis);
  245. return {
  246. ...location,
  247. query: queryStringObject,
  248. };
  249. }
  250. const currentSort = eventView.sortForField(field, tableMeta);
  251. const canSort = isFieldSortable(field, tableMeta);
  252. let titleText = isEquationAlias(column.name)
  253. ? eventView.getEquations()[getEquationAliasIndex(column.name)]
  254. : column.name;
  255. if (column.name.toLowerCase() === 'replayid') {
  256. titleText = 'Replay';
  257. }
  258. const title = (
  259. <StyledTooltip title={titleText}>
  260. <Truncate value={titleText} maxLength={60} expandable={false} />
  261. </StyledTooltip>
  262. );
  263. return (
  264. <SortLink
  265. align={align}
  266. title={title}
  267. direction={currentSort ? currentSort.kind : undefined}
  268. canSort={canSort}
  269. generateSortLink={generateSortLink}
  270. />
  271. );
  272. }
  273. function _renderGridBodyCell(
  274. column: TableColumn<keyof TableDataRow>,
  275. dataRow: TableDataRow,
  276. rowIndex: number,
  277. columnIndex: number
  278. ): React.ReactNode {
  279. const {isFirstPage, eventView, location, organization, tableData, isHomepage} = props;
  280. if (!tableData || !tableData.meta) {
  281. return dataRow[column.key];
  282. }
  283. const columnKey = String(column.key);
  284. const fieldRenderer = getFieldRenderer(columnKey, tableData.meta, false);
  285. const display = eventView.getDisplayMode();
  286. const isTopEvents =
  287. display === DisplayModes.TOP5 || display === DisplayModes.DAILYTOP5;
  288. const topEvents = eventView.topEvents ? parseInt(eventView.topEvents, 10) : TOP_N;
  289. const count = Math.min(tableData?.data?.length ?? topEvents, topEvents);
  290. const unit = tableData.meta.units?.[columnKey];
  291. let cell = fieldRenderer(dataRow, {organization, location, unit});
  292. if (columnKey === 'id') {
  293. let target;
  294. if (dataRow['event.type'] !== 'transaction') {
  295. const project = dataRow.project || dataRow['project.name'];
  296. target = {
  297. // NOTE: This uses a legacy redirect for project event to the issue group event link.
  298. // This only works with dev-server or production.
  299. pathname: normalizeUrl(
  300. `/${organization.slug}/${project}/events/${dataRow.id}/`
  301. ),
  302. query: {...location.query, referrer: 'discover-events-table'},
  303. };
  304. } else {
  305. if (!dataRow.trace) {
  306. throw new Error(
  307. 'Transaction event should always have a trace associated with it.'
  308. );
  309. }
  310. target = generateLinkToEventInTraceView({
  311. traceSlug: dataRow.trace?.toString(),
  312. eventId: dataRow.id,
  313. projectSlug: (dataRow.project || dataRow['project.name']).toString(),
  314. timestamp: dataRow.timestamp,
  315. organization,
  316. isHomepage,
  317. location,
  318. eventView,
  319. type: 'discover',
  320. source: TraceViewSources.DISCOVER,
  321. });
  322. }
  323. const idLink = (
  324. <StyledLink data-test-id="view-event" to={target}>
  325. {cell}
  326. </StyledLink>
  327. );
  328. cell = (
  329. <QuickContextHoverWrapper
  330. organization={organization}
  331. dataRow={dataRow}
  332. contextType={ContextType.EVENT}
  333. projects={projects}
  334. eventView={eventView}
  335. >
  336. {idLink}
  337. </QuickContextHoverWrapper>
  338. );
  339. } else if (columnKey === 'transaction' && dataRow.transaction) {
  340. cell = (
  341. <TransactionLink
  342. data-test-id="tableView-transaction-link"
  343. to={getTargetForTransactionSummaryLink(
  344. dataRow,
  345. organization,
  346. projects,
  347. eventView,
  348. location
  349. )}
  350. >
  351. {cell}
  352. </TransactionLink>
  353. );
  354. } else if (columnKey === 'trace') {
  355. const timestamp = getTimeStampFromTableDateField(
  356. dataRow['max(timestamp)'] ?? dataRow.timestamp
  357. );
  358. const dateSelection = eventView.normalizeDateSelection(location);
  359. if (dataRow.trace) {
  360. const target = getTraceDetailsUrl({
  361. organization,
  362. traceSlug: String(dataRow.trace),
  363. dateSelection,
  364. timestamp,
  365. location,
  366. source: TraceViewSources.DISCOVER,
  367. });
  368. cell = (
  369. <Tooltip title={t('View Trace')}>
  370. <StyledLink data-test-id="view-trace" to={target}>
  371. {cell}
  372. </StyledLink>
  373. </Tooltip>
  374. );
  375. }
  376. } else if (columnKey === 'replayId') {
  377. if (dataRow.replayId) {
  378. if (!dataRow['project.name']) {
  379. return getShortEventId(String(dataRow.replayId));
  380. }
  381. const target = replayLinkGenerator(organization, dataRow, undefined);
  382. cell = (
  383. <ViewReplayLink replayId={dataRow.replayId} to={target}>
  384. {cell}
  385. </ViewReplayLink>
  386. );
  387. }
  388. } else if (columnKey === 'profile.id') {
  389. const projectSlug = dataRow.project || dataRow['project.name'];
  390. const profileId = dataRow['profile.id'];
  391. if (projectSlug && profileId) {
  392. const target = generateProfileFlamechartRoute({
  393. orgSlug: organization.slug,
  394. projectSlug: String(projectSlug),
  395. profileId: String(profileId),
  396. });
  397. cell = (
  398. <StyledTooltip title={t('View Profile')}>
  399. <StyledLink
  400. data-test-id="view-profile"
  401. to={target}
  402. onClick={() =>
  403. trackAnalytics('profiling_views.go_to_flamegraph', {
  404. organization,
  405. source: 'discover.table',
  406. })
  407. }
  408. >
  409. {cell}
  410. </StyledLink>
  411. </StyledTooltip>
  412. );
  413. }
  414. }
  415. const topResultsIndicator =
  416. isFirstPage && isTopEvents && rowIndex < topEvents && columnIndex === 0 ? (
  417. // Add one if we need to include Other in the series
  418. <TopResultsIndicator count={count} index={rowIndex} />
  419. ) : null;
  420. const fieldName = columnKey;
  421. const value = dataRow[fieldName];
  422. if (
  423. tableData.meta[fieldName] === 'integer' &&
  424. typeof value === 'number' &&
  425. value > 999
  426. ) {
  427. return (
  428. <Tooltip
  429. title={value.toLocaleString()}
  430. containerDisplayMode="block"
  431. position="right"
  432. >
  433. {topResultsIndicator}
  434. <CellAction
  435. column={column}
  436. dataRow={dataRow}
  437. handleCellAction={handleCellAction(dataRow, column)}
  438. >
  439. {cell}
  440. </CellAction>
  441. </Tooltip>
  442. );
  443. }
  444. return (
  445. <Fragment>
  446. {topResultsIndicator}
  447. <CellAction
  448. column={column}
  449. dataRow={dataRow}
  450. handleCellAction={handleCellAction(dataRow, column)}
  451. >
  452. {cell}
  453. </CellAction>
  454. </Fragment>
  455. );
  456. }
  457. function handleEditColumns() {
  458. const {
  459. organization,
  460. eventView,
  461. measurementKeys,
  462. spanOperationBreakdownKeys,
  463. customMeasurements,
  464. dataset,
  465. } = props;
  466. openModal(
  467. modalProps => (
  468. <ColumnEditModal
  469. {...modalProps}
  470. organization={organization}
  471. measurementKeys={measurementKeys}
  472. spanOperationBreakdownKeys={spanOperationBreakdownKeys}
  473. columns={eventView.getColumns().map(col => col.column)}
  474. onApply={handleUpdateColumns}
  475. customMeasurements={customMeasurements}
  476. dataset={dataset}
  477. />
  478. ),
  479. {modalCss, closeEvents: 'escape-key'}
  480. );
  481. }
  482. function handleCellAction(
  483. dataRow: TableDataRow,
  484. column: TableColumn<keyof TableDataRow>
  485. ) {
  486. return (action: Actions, value: React.ReactText) => {
  487. const {eventView, organization, location, tableData, isHomepage, queryDataset} =
  488. props;
  489. const query = new MutableSearch(eventView.query);
  490. let nextView = eventView.clone();
  491. trackAnalytics('discover_v2.results.cellaction', {
  492. organization,
  493. action,
  494. });
  495. switch (action) {
  496. case Actions.RELEASE: {
  497. const maybeProject = projects.find(project => {
  498. return project.slug === dataRow.project;
  499. });
  500. browserHistory.push(
  501. normalizeUrl({
  502. pathname: `/organizations/${
  503. organization.slug
  504. }/releases/${encodeURIComponent(value)}/`,
  505. query: {
  506. ...nextView.getPageFiltersQuery(),
  507. project: maybeProject ? maybeProject.id : undefined,
  508. },
  509. })
  510. );
  511. return;
  512. }
  513. case Actions.DRILLDOWN: {
  514. // count_unique(column) drilldown
  515. trackAnalytics('discover_v2.results.drilldown', {
  516. organization,
  517. });
  518. // Drilldown into each distinct value and get a count() for each value.
  519. nextView = getExpandedResults(nextView, {}, dataRow).withNewColumn({
  520. kind: 'function',
  521. function: ['count', '', undefined, undefined],
  522. });
  523. browserHistory.push(
  524. normalizeUrl(
  525. nextView.getResultsViewUrlTarget(
  526. organization.slug,
  527. isHomepage,
  528. hasDatasetSelector(organization) ? queryDataset : undefined
  529. )
  530. )
  531. );
  532. return;
  533. }
  534. default: {
  535. // Some custom perf metrics have units.
  536. // These custom perf metrics need to be adjusted to the correct value.
  537. let cellValue = value;
  538. const unit = tableData?.meta?.units?.[column.name];
  539. if (typeof cellValue === 'number' && unit) {
  540. if (Object.keys(SIZE_UNITS).includes(unit)) {
  541. cellValue *= SIZE_UNITS[unit];
  542. } else if (Object.keys(DURATION_UNITS).includes(unit)) {
  543. cellValue *= DURATION_UNITS[unit];
  544. }
  545. }
  546. updateQuery(query, action, column, cellValue);
  547. }
  548. }
  549. nextView.query = query.formatString();
  550. const target = nextView.getResultsViewUrlTarget(
  551. organization.slug,
  552. isHomepage,
  553. hasDatasetSelector(organization) ? queryDataset : undefined
  554. );
  555. // Get yAxis from location
  556. target.query.yAxis = decodeList(location.query.yAxis);
  557. browserHistory.push(normalizeUrl(target));
  558. };
  559. }
  560. function handleUpdateColumns(columns: Column[]): void {
  561. const {organization, eventView, location, isHomepage, queryDataset} = props;
  562. // metrics
  563. trackAnalytics('discover_v2.update_columns', {
  564. organization,
  565. });
  566. const nextView = eventView.withColumns(columns);
  567. const resultsViewUrlTarget = nextView.getResultsViewUrlTarget(
  568. organization.slug,
  569. isHomepage,
  570. hasDatasetSelector(organization) ? queryDataset : undefined
  571. );
  572. // Need to pull yAxis from location since eventView only stores 1 yAxis field at time
  573. const previousYAxis = decodeList(location.query.yAxis);
  574. resultsViewUrlTarget.query.yAxis = previousYAxis.filter(yAxis =>
  575. nextView.getYAxisOptions().find(({value}) => value === yAxis)
  576. );
  577. browserHistory.push(normalizeUrl(resultsViewUrlTarget));
  578. }
  579. function renderHeaderButtons() {
  580. const {
  581. organization,
  582. title,
  583. eventView,
  584. isLoading,
  585. error,
  586. tableData,
  587. location,
  588. onChangeShowTags,
  589. showTags,
  590. } = props;
  591. return (
  592. <TableActions
  593. title={title}
  594. isLoading={isLoading}
  595. error={error}
  596. organization={organization}
  597. eventView={eventView}
  598. onEdit={handleEditColumns}
  599. tableData={tableData}
  600. location={location}
  601. onChangeShowTags={onChangeShowTags}
  602. showTags={showTags}
  603. supportsInvestigationRule
  604. />
  605. );
  606. }
  607. const {error, eventView, isLoading, tableData} = props;
  608. const columnOrder = eventView.getColumns();
  609. const columnSortBy = eventView.getSorts();
  610. const prependColumnWidths = eventView.hasAggregateField()
  611. ? ['40px']
  612. : eventView.hasIdField()
  613. ? []
  614. : [`minmax(${COL_WIDTH_MINIMUM}px, max-content)`];
  615. return (
  616. <GridEditable
  617. isLoading={isLoading}
  618. error={error}
  619. data={tableData ? tableData.data : []}
  620. columnOrder={columnOrder}
  621. columnSortBy={columnSortBy}
  622. title={t('Results')}
  623. grid={{
  624. renderHeadCell: _renderGridHeaderCell as any,
  625. renderBodyCell: _renderGridBodyCell as any,
  626. onResizeColumn: _resizeColumn as any,
  627. renderPrependColumns: _renderPrependColumns as any,
  628. prependColumnWidths,
  629. }}
  630. headerButtons={renderHeaderButtons}
  631. />
  632. );
  633. }
  634. const PrependHeader = styled('span')`
  635. color: ${p => p.theme.subText};
  636. `;
  637. const StyledTooltip = styled(Tooltip)`
  638. display: initial;
  639. max-width: max-content;
  640. `;
  641. export const StyledLink = styled(Link)`
  642. & div {
  643. display: inline;
  644. }
  645. `;
  646. export const TransactionLink = styled(Link)`
  647. ${p => p.theme.overflowEllipsis}
  648. `;
  649. const StyledIcon = styled(IconStack)`
  650. vertical-align: middle;
  651. `;
  652. export default TableView;