content.tsx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. import {Fragment, useCallback, useMemo} from 'react';
  2. import styled from '@emotion/styled';
  3. import {Button, LinkButton} from 'sentry/components/button';
  4. import ErrorPanel from 'sentry/components/charts/errorPanel';
  5. import {SectionHeading} from 'sentry/components/charts/styles';
  6. import {CompactSelect} from 'sentry/components/compactSelect';
  7. import type {SelectOption} from 'sentry/components/compactSelect/types';
  8. import Count from 'sentry/components/count';
  9. import {DateTime} from 'sentry/components/dateTime';
  10. import Link from 'sentry/components/links/link';
  11. import LoadingIndicator from 'sentry/components/loadingIndicator';
  12. import Pagination from 'sentry/components/pagination';
  13. import PerformanceDuration from 'sentry/components/performanceDuration';
  14. import {AggregateFlamegraph} from 'sentry/components/profiling/flamegraph/aggregateFlamegraph';
  15. import {AggregateFlamegraphTreeTable} from 'sentry/components/profiling/flamegraph/aggregateFlamegraphTreeTable';
  16. import {FlamegraphSearch} from 'sentry/components/profiling/flamegraph/flamegraphToolbar/flamegraphSearch';
  17. import {SegmentedControl} from 'sentry/components/segmentedControl';
  18. import {IconProfiling, IconWarning} from 'sentry/icons';
  19. import {t} from 'sentry/locale';
  20. import {space} from 'sentry/styles/space';
  21. import type {DeepPartial} from 'sentry/types/utils';
  22. import {trackAnalytics} from 'sentry/utils/analytics';
  23. import {browserHistory} from 'sentry/utils/browserHistory';
  24. import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
  25. import {getShortEventId} from 'sentry/utils/events';
  26. import {isEmptyObject} from 'sentry/utils/object/isEmptyObject';
  27. import type {CanvasScheduler} from 'sentry/utils/profiling/canvasScheduler';
  28. import {
  29. CanvasPoolManager,
  30. useCanvasScheduler,
  31. } from 'sentry/utils/profiling/canvasScheduler';
  32. import type {FlamegraphState} from 'sentry/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContext';
  33. import {FlamegraphStateProvider} from 'sentry/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContextProvider';
  34. import {FlamegraphThemeProvider} from 'sentry/utils/profiling/flamegraph/flamegraphThemeProvider';
  35. import type {Frame} from 'sentry/utils/profiling/frame';
  36. import {isEventedProfile, isSampledProfile} from 'sentry/utils/profiling/guards/profile';
  37. import {useAggregateFlamegraphQuery} from 'sentry/utils/profiling/hooks/useAggregateFlamegraphQuery';
  38. import type {ProfilingFieldType} from 'sentry/utils/profiling/hooks/useProfileEvents';
  39. import {useProfileEvents} from 'sentry/utils/profiling/hooks/useProfileEvents';
  40. import {decodeScalar} from 'sentry/utils/queryString';
  41. import {useLocalStorageState} from 'sentry/utils/useLocalStorageState';
  42. import {useLocation} from 'sentry/utils/useLocation';
  43. import useOrganization from 'sentry/utils/useOrganization';
  44. import {
  45. FlamegraphProvider,
  46. useFlamegraph,
  47. } from 'sentry/views/profiling/flamegraphProvider';
  48. import {ProfileGroupProvider} from 'sentry/views/profiling/profileGroupProvider';
  49. import {TraceViewSources} from '../../newTraceDetails/traceHeader/breadcrumbs';
  50. import {generateProfileLink} from '../utils';
  51. const DEFAULT_FLAMEGRAPH_PREFERENCES: DeepPartial<FlamegraphState> = {
  52. preferences: {
  53. sorting: 'left heavy' satisfies FlamegraphState['preferences']['sorting'],
  54. },
  55. };
  56. const noop = () => void 0;
  57. interface TransactionProfilesContentProps {
  58. query: string;
  59. transaction: string;
  60. }
  61. export function TransactionProfilesContent(props: TransactionProfilesContentProps) {
  62. return (
  63. <TransactionProfilesContentContainer>
  64. <ProfileVisualization {...props} />
  65. <ProfileSidebarContainer>
  66. <ProfileDigest {...props} />
  67. <ProfileList {...props} />
  68. </ProfileSidebarContainer>
  69. </TransactionProfilesContentContainer>
  70. );
  71. }
  72. function isEmpty(resp: Profiling.Schema) {
  73. const profile = resp.profiles[0];
  74. if (!profile) {
  75. return true;
  76. }
  77. if (
  78. resp.profiles.length === 1 &&
  79. isSampledProfile(profile) &&
  80. profile.startValue === 0 &&
  81. profile.endValue === 0
  82. ) {
  83. return true;
  84. }
  85. if (
  86. resp.profiles.length === 1 &&
  87. isEventedProfile(profile) &&
  88. profile.startValue === 0 &&
  89. profile.endValue === 0
  90. ) {
  91. return true;
  92. }
  93. return false;
  94. }
  95. function ProfileVisualization(props: TransactionProfilesContentProps) {
  96. const {data, status} = useAggregateFlamegraphQuery({
  97. query: props.query,
  98. });
  99. const [frameFilter, setFrameFilter] = useLocalStorageState<
  100. 'system' | 'application' | 'all'
  101. >('flamegraph-frame-filter', 'application');
  102. const onFrameFilterChange = useCallback(
  103. (value: 'system' | 'application' | 'all') => {
  104. setFrameFilter(value);
  105. },
  106. [setFrameFilter]
  107. );
  108. const onResetFrameFilter = useCallback(() => {
  109. setFrameFilter('all');
  110. }, [setFrameFilter]);
  111. const flamegraphFrameFilter: ((frame: Frame) => boolean) | undefined = useMemo(() => {
  112. if (frameFilter === 'all') {
  113. return () => true;
  114. }
  115. if (frameFilter === 'application') {
  116. return frame => frame.is_application;
  117. }
  118. return frame => !frame.is_application;
  119. }, [frameFilter]);
  120. const [visualization, setVisualization] = useLocalStorageState<
  121. 'flamegraph' | 'call tree'
  122. >('flamegraph-visualization', 'flamegraph');
  123. const onVisualizationChange = useCallback(
  124. (value: 'flamegraph' | 'call tree') => {
  125. setVisualization(value);
  126. },
  127. [setVisualization]
  128. );
  129. const canvasPoolManager = useMemo(() => new CanvasPoolManager(), []);
  130. const scheduler = useCanvasScheduler(canvasPoolManager);
  131. return (
  132. <ProfileVisualizationContainer>
  133. <ProfileGroupProvider
  134. traceID=""
  135. type="flamegraph"
  136. input={data ?? null}
  137. frameFilter={flamegraphFrameFilter}
  138. >
  139. <FlamegraphStateProvider initialState={DEFAULT_FLAMEGRAPH_PREFERENCES}>
  140. <FlamegraphThemeProvider>
  141. <FlamegraphProvider>
  142. <AggregateFlamegraphToolbar
  143. scheduler={scheduler}
  144. canvasPoolManager={canvasPoolManager}
  145. visualization={visualization}
  146. onVisualizationChange={onVisualizationChange}
  147. frameFilter={frameFilter}
  148. onFrameFilterChange={onFrameFilterChange}
  149. hideSystemFrames={false}
  150. setHideSystemFrames={noop}
  151. />
  152. <FlamegraphContainer>
  153. {visualization === 'flamegraph' ? (
  154. <AggregateFlamegraph
  155. status={status}
  156. filter={frameFilter}
  157. onResetFilter={onResetFrameFilter}
  158. canvasPoolManager={canvasPoolManager}
  159. scheduler={scheduler}
  160. />
  161. ) : (
  162. <AggregateFlamegraphTreeTable
  163. recursion={null}
  164. expanded={false}
  165. frameFilter={frameFilter}
  166. canvasPoolManager={canvasPoolManager}
  167. withoutBorders
  168. />
  169. )}
  170. </FlamegraphContainer>
  171. {status === 'pending' ? (
  172. <RequestStateMessageContainer>
  173. <LoadingIndicator />
  174. </RequestStateMessageContainer>
  175. ) : status === 'error' ? (
  176. <RequestStateMessageContainer>
  177. {t('There was an error loading the flamegraph.')}
  178. </RequestStateMessageContainer>
  179. ) : isEmpty(data) ? (
  180. <RequestStateMessageContainer>
  181. {t('No profiling data found')}
  182. </RequestStateMessageContainer>
  183. ) : null}
  184. </FlamegraphProvider>
  185. </FlamegraphThemeProvider>
  186. </FlamegraphStateProvider>
  187. </ProfileGroupProvider>
  188. </ProfileVisualizationContainer>
  189. );
  190. }
  191. interface AggregateFlamegraphToolbarProps {
  192. canvasPoolManager: CanvasPoolManager;
  193. frameFilter: 'system' | 'application' | 'all';
  194. hideSystemFrames: boolean;
  195. onFrameFilterChange: (value: 'system' | 'application' | 'all') => void;
  196. onVisualizationChange: (value: 'flamegraph' | 'call tree') => void;
  197. scheduler: CanvasScheduler;
  198. setHideSystemFrames: (value: boolean) => void;
  199. visualization: 'flamegraph' | 'call tree';
  200. }
  201. function AggregateFlamegraphToolbar(props: AggregateFlamegraphToolbarProps) {
  202. const flamegraph = useFlamegraph();
  203. const flamegraphs = useMemo(() => [flamegraph], [flamegraph]);
  204. const spans = useMemo(() => [], []);
  205. const frameSelectOptions: SelectOption<'system' | 'application' | 'all'>[] =
  206. useMemo(() => {
  207. return [
  208. {value: 'system', label: t('System Frames')},
  209. {value: 'application', label: t('Application Frames')},
  210. {value: 'all', label: t('All Frames')},
  211. ];
  212. }, []);
  213. const onResetZoom = useCallback(() => {
  214. props.scheduler.dispatch('reset zoom');
  215. }, [props.scheduler]);
  216. const onFrameFilterChange = useCallback(
  217. (value: {value: 'application' | 'system' | 'all'}) => {
  218. props.onFrameFilterChange(value.value);
  219. },
  220. [props]
  221. );
  222. return (
  223. <AggregateFlamegraphToolbarContainer>
  224. <ViewSelectContainer>
  225. <SegmentedControl
  226. aria-label={t('View')}
  227. size="xs"
  228. value={props.visualization}
  229. onChange={props.onVisualizationChange}
  230. >
  231. <SegmentedControl.Item key="flamegraph">
  232. {t('Flamegraph')}
  233. </SegmentedControl.Item>
  234. <SegmentedControl.Item key="call tree">{t('Call Tree')}</SegmentedControl.Item>
  235. </SegmentedControl>
  236. </ViewSelectContainer>
  237. <AggregateFlamegraphSearch
  238. spans={spans}
  239. canvasPoolManager={props.canvasPoolManager}
  240. flamegraphs={flamegraphs}
  241. />
  242. <Button size="xs" onClick={onResetZoom}>
  243. {t('Reset Zoom')}
  244. </Button>
  245. <CompactSelect
  246. onChange={onFrameFilterChange}
  247. value={props.frameFilter}
  248. size="xs"
  249. options={frameSelectOptions}
  250. />
  251. </AggregateFlamegraphToolbarContainer>
  252. );
  253. }
  254. const PERCENTILE_DIGESTS = [
  255. 'p50()',
  256. 'p75()',
  257. 'p95()',
  258. 'p99()',
  259. ] satisfies ProfilingFieldType[];
  260. const ALL_DIGESTS = [
  261. ...PERCENTILE_DIGESTS,
  262. 'last_seen()',
  263. 'count()',
  264. ] satisfies ProfilingFieldType[];
  265. function ProfileDigest({query}: TransactionProfilesContentProps) {
  266. const organization = useOrganization();
  267. const profilesSummary = useProfileEvents<ProfilingFieldType>({
  268. fields: ALL_DIGESTS,
  269. query,
  270. sort: {key: 'last_seen()', order: 'desc'},
  271. referrer: 'api.profiling.profile-summary-table',
  272. continuousProfilingCompat: organization.features.includes(
  273. 'continuous-profiling-compat'
  274. ),
  275. });
  276. const digestData = profilesSummary.data?.data?.[0];
  277. return (
  278. <ProfileDigestContainer>
  279. <ProfileDigestLabel>{t('Last Seen')}</ProfileDigestLabel>
  280. <ProfileDigestValue align="right">
  281. {profilesSummary.isPending ? (
  282. ''
  283. ) : profilesSummary.isError ? (
  284. ''
  285. ) : (
  286. <DateTime date={new Date(digestData?.['last_seen()'] as string)} />
  287. )}
  288. </ProfileDigestValue>
  289. <ProfileDigestLabel>{t('Count')}</ProfileDigestLabel>
  290. <ProfileDigestValue align="right">
  291. {profilesSummary.isPending ? (
  292. ''
  293. ) : profilesSummary.isError ? (
  294. ''
  295. ) : (
  296. <Count value={digestData?.['count()'] as number} />
  297. )}
  298. </ProfileDigestValue>
  299. {PERCENTILE_DIGESTS.map(percentile => (
  300. <Fragment key={percentile}>
  301. <ProfileDigestLabel>
  302. {percentile.substring(0, percentile.length - 2)}
  303. </ProfileDigestLabel>
  304. <ProfileDigestValue align="right">
  305. {profilesSummary.isPending ? (
  306. ''
  307. ) : profilesSummary.isError ? (
  308. ''
  309. ) : (
  310. <PerformanceDuration
  311. milliseconds={digestData?.[percentile] as number}
  312. abbreviation
  313. />
  314. )}
  315. </ProfileDigestValue>
  316. </Fragment>
  317. ))}
  318. </ProfileDigestContainer>
  319. );
  320. }
  321. const ALLOWED_SORTS = [
  322. '-timestamp',
  323. 'timestamp',
  324. '-transaction.duration',
  325. 'transaction.duration',
  326. ] as const;
  327. type SortOption = (typeof ALLOWED_SORTS)[number];
  328. const sortOptions: SelectOption<SortOption>[] = [
  329. {value: '-timestamp', label: t('Newest Events')},
  330. {value: 'timestamp', label: t('Oldest Events')},
  331. {value: '-transaction.duration', label: t('Slowest Events')},
  332. {value: 'transaction.duration', label: t('Fastest Events')},
  333. ];
  334. const PROFILES_SORT = 'profilesSort';
  335. const PROFILES_CURSOR = 'profilesCursor';
  336. function ProfileList({query: userQuery, transaction}: TransactionProfilesContentProps) {
  337. const location = useLocation();
  338. const organization = useOrganization();
  339. const sortValue = useMemo(() => {
  340. const rawSort = decodeScalar(location.query[PROFILES_SORT]);
  341. if (ALLOWED_SORTS.includes(rawSort as any)) {
  342. return rawSort as SortOption;
  343. }
  344. return '-timestamp' as const;
  345. }, [location.query]);
  346. const sort = useMemo(() => {
  347. if (sortValue === '-timestamp') {
  348. return {key: 'timestamp', order: 'desc'} as const;
  349. }
  350. if (sortValue === 'timestamp') {
  351. return {key: 'timestamp', order: 'asc'} as const;
  352. }
  353. if (sortValue === '-transaction.duration') {
  354. return {key: 'transaction.duration', order: 'desc'} as const;
  355. }
  356. if (sortValue === 'transaction.duration') {
  357. return {key: 'transaction.duration', order: 'asc'} as const;
  358. }
  359. throw new Error(`Unsupport sort: ${sortValue}`);
  360. }, [sortValue]);
  361. const cursor = useMemo(
  362. () => decodeScalar(location.query[PROFILES_CURSOR]),
  363. [location.query]
  364. );
  365. const profilesList = useProfileEvents<ProfilingFieldType>({
  366. fields: [
  367. 'id',
  368. 'project.name',
  369. 'trace',
  370. 'transaction.duration',
  371. 'profile.id',
  372. 'profiler.id',
  373. 'thread.id',
  374. 'precise.start_ts',
  375. 'precise.finish_ts',
  376. 'timestamp',
  377. ],
  378. query: userQuery,
  379. sort,
  380. referrer: 'api.profiling.profile-summary-table',
  381. cursor,
  382. limit: 10,
  383. continuousProfilingCompat: organization.features.includes(
  384. 'continuous-profiling-compat'
  385. ),
  386. });
  387. const handleSort = useCallback(
  388. (value: {value: SortOption}) => {
  389. browserHistory.push({
  390. ...location,
  391. query: {
  392. ...location.query,
  393. [PROFILES_SORT]: value.value,
  394. [PROFILES_CURSOR]: undefined,
  395. },
  396. });
  397. },
  398. [location]
  399. );
  400. const handleCursor = useCallback((newCursor, pathname, query) => {
  401. browserHistory.push({
  402. pathname,
  403. query: {...query, [PROFILES_CURSOR]: newCursor},
  404. });
  405. }, []);
  406. return (
  407. <ProfileListContainer>
  408. <ProfileListControls>
  409. <CompactSelect
  410. onChange={handleSort}
  411. value={sortValue}
  412. size="xs"
  413. options={sortOptions}
  414. />
  415. <StyledPagination
  416. pageLinks={profilesList.getResponseHeader?.('Link')}
  417. onCursor={handleCursor}
  418. size="xs"
  419. />
  420. </ProfileListControls>
  421. {profilesList.isPending ? (
  422. <LoadingIndicator />
  423. ) : profilesList.isError ? (
  424. <ErrorPanel>
  425. <IconWarning color="gray300" size="lg" />
  426. </ErrorPanel>
  427. ) : (
  428. <ProfileListResultsContainer>
  429. <ProfileDigestLabel>{t('Event ID')}</ProfileDigestLabel>
  430. <ProfileDigestLabel align="right">{t('Duration')}</ProfileDigestLabel>
  431. <ProfileDigestLabel align="right">{t('Profile')}</ProfileDigestLabel>
  432. {profilesList.data?.data?.map(row => {
  433. const traceTarget = generateLinkToEventInTraceView({
  434. eventId: row.id as string,
  435. timestamp: row.timestamp as string,
  436. traceSlug: row.trace as string,
  437. projectSlug: row['project.name'] as string,
  438. location,
  439. organization,
  440. transactionName: transaction,
  441. source: TraceViewSources.PERFORMANCE_TRANSACTION_SUMMARY_PROFILES,
  442. });
  443. const profileTarget = generateProfileLink()(
  444. organization,
  445. {
  446. id: row.id as string,
  447. 'project.name': row['project.name'] as string,
  448. 'profile.id': (row['profile.id'] as string) || '',
  449. 'profiler.id': (row['profiler.id'] as string) || '',
  450. 'thread.id': (row['thread.id'] as string) || '',
  451. 'precise.start_ts': row['precise.start_ts'] as number,
  452. 'precise.finish_ts': row['precise.finish_ts'] as number,
  453. trace: row.trace as string,
  454. },
  455. location
  456. );
  457. return (
  458. <Fragment key={row.id as string}>
  459. <ProfileDigestValue align="left">
  460. <Link to={traceTarget}>{getShortEventId(row.id as string)}</Link>
  461. </ProfileDigestValue>
  462. <ProfileDigestValue align="right">
  463. <PerformanceDuration
  464. milliseconds={(row?.['transaction.duration'] as number) ?? 0}
  465. abbreviation
  466. />
  467. </ProfileDigestValue>
  468. <ProfileDigestValue align="right">
  469. <LinkButton
  470. disabled={!profileTarget || isEmptyObject(profileTarget)}
  471. to={profileTarget || {}}
  472. onClick={() => {
  473. trackAnalytics('profiling_views.go_to_flamegraph', {
  474. organization,
  475. source: 'profiling_transaction.profiles_table',
  476. });
  477. }}
  478. size="xs"
  479. >
  480. <IconProfiling size="xs" />
  481. </LinkButton>
  482. </ProfileDigestValue>
  483. </Fragment>
  484. );
  485. })}
  486. </ProfileListResultsContainer>
  487. )}
  488. </ProfileListContainer>
  489. );
  490. }
  491. const TransactionProfilesContentContainer = styled('div')`
  492. display: grid;
  493. /* false positive for grid layout */
  494. /* stylelint-disable */
  495. grid-template-areas: 'visualization digest';
  496. grid-template-columns: 1fr 250px;
  497. flex: 1;
  498. border: 1px solid ${p => p.theme.border};
  499. border-radius: ${p => p.theme.borderRadius};
  500. overflow: hidden;
  501. `;
  502. const ProfileVisualizationContainer = styled('div')`
  503. grid-area: visualization;
  504. display: grid;
  505. grid-template-rows: min-content 1fr;
  506. height: 100%;
  507. position: relative;
  508. `;
  509. const FlamegraphContainer = styled('div')`
  510. overflow: hidden;
  511. display: flex;
  512. `;
  513. const RequestStateMessageContainer = styled('div')`
  514. position: absolute;
  515. left: 0;
  516. right: 0;
  517. top: 0;
  518. bottom: 0;
  519. display: flex;
  520. justify-content: center;
  521. align-items: center;
  522. color: ${p => p.theme.subText};
  523. pointer-events: none;
  524. `;
  525. const AggregateFlamegraphToolbarContainer = styled('div')`
  526. display: flex;
  527. justify-content: space-between;
  528. gap: ${space(1)};
  529. padding: ${space(1)};
  530. background-color: ${p => p.theme.background};
  531. /*
  532. force height to be the same as profile digest header,
  533. but subtract 1px for the border that doesnt exist on the header
  534. */
  535. height: 41px;
  536. border-bottom: 1px solid ${p => p.theme.border};
  537. `;
  538. const ViewSelectContainer = styled('div')`
  539. min-width: 160px;
  540. `;
  541. const AggregateFlamegraphSearch = styled(FlamegraphSearch)`
  542. max-width: 300px;
  543. `;
  544. const ProfileSidebarContainer = styled('div')`
  545. grid-area: digest;
  546. border-left: 1px solid ${p => p.theme.border};
  547. background-color: ${p => p.theme.background};
  548. position: relative;
  549. overflow: hidden;
  550. display: grid;
  551. grid-template-rows: min-content 1fr;
  552. `;
  553. const ProfileDigestContainer = styled('div')`
  554. display: grid;
  555. grid-template-columns: min-content 1fr;
  556. padding: ${space(2)};
  557. gap: ${space(1)};
  558. `;
  559. const ProfileListContainer = styled('div')`
  560. padding: ${space(2)};
  561. border-top: 1px solid ${p => p.theme.border};
  562. `;
  563. const ProfileListControls = styled('div')`
  564. display: flex;
  565. justify-content: space-between;
  566. margin-bottom: ${space(2)};
  567. `;
  568. const StyledPagination = styled(Pagination)`
  569. margin: 0;
  570. `;
  571. const ProfileListResultsContainer = styled('div')`
  572. display: grid;
  573. grid-template-columns: min-content 1fr min-content;
  574. gap: ${space(1)};
  575. `;
  576. const ProfileDigestLabel = styled(SectionHeading)<{align?: 'left' | 'right'}>`
  577. margin: 0;
  578. text-transform: uppercase;
  579. text-wrap: nowrap;
  580. text-align: ${p => p.align ?? 'left'};
  581. `;
  582. const ProfileDigestValue = styled('div')<{align: 'left' | 'right'}>`
  583. text-align: ${p => p.align};
  584. `;