-
-```tsx
-import React, { FC } from 'react';
-import { Typography, Grid } from '@material-ui/core';
-import {
- InfoCard,
- Header,
- Page,
- pageTheme,
- Content,
- ContentHeader,
- HeaderLabel,
- SupportButton,
- identityApiRef,
-} from '@backstage/core';
-import { useApi } from '@backstage/core-api';
-import ExampleFetchComponent from '../ExampleFetchComponent';
-
-const ExampleComponent: FC<{}> = () => {
- const identityApi = useApi(identityApiRef);
- const userId = identityApi.getUserId();
- const profile = identityApi.getProfile();
-
- return (
-
-
-```tsx
-import React, { FC } from 'react';
-import { useAsync } from 'react-use';
-import Alert from '@material-ui/lab/Alert';
-import {
- Table,
- TableColumn,
- Progress,
- githubAuthApiRef,
-} from '@backstage/core';
-import { useApi } from '@backstage/core-api';
-import { graphql } from '@octokit/graphql';
-
-const query = `{
-viewer {
- repositories(first: 100) {
- totalCount
- nodes {
- name
- createdAt
- description
- diskUsage
- isFork
- }
- pageInfo {
- endCursor
- hasNextPage
- }
- }
-}
-}`;
-
-type Node = {
- name: string;
- createdAt: string;
- description: string;
- diskUsage: number;
- isFork: boolean;
-};
-
-type Viewer = {
- repositories: {
- totalCount: number;
- nodes: Node[];
- pageInfo: {
- endCursor: string;
- hasNextPage: boolean;
- };
- };
-};
-
-type DenseTableProps = {
- viewer: Viewer;
-};
-
-export const DenseTable: FC
- );
-};
-
-const ExampleFetchComponent: FC<{}> = () => {
- const auth = useApi(githubAuthApiRef);
-
- const { value, loading, error } = useAsync(async (): Promise
- );
-};
-
-export default ExampleFetchComponent;
-```
-
-