emptyState.tsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import {LinkButton} from 'sentry/components/button';
  2. import EmptyMessage from 'sentry/components/emptyMessage';
  3. import EmptyStateWarning from 'sentry/components/emptyStateWarning';
  4. import {Body, Main} from 'sentry/components/layouts/thirds';
  5. import Panel from 'sentry/components/panels/panel';
  6. import PanelBody from 'sentry/components/panels/panelBody';
  7. import {IconCommit} from 'sentry/icons';
  8. import {t} from 'sentry/locale';
  9. type Props = {
  10. children: React.ReactNode;
  11. };
  12. export function EmptyState({children}: Props) {
  13. return (
  14. <Panel>
  15. <PanelBody>
  16. <EmptyStateWarning>
  17. <p>{children}</p>
  18. </EmptyStateWarning>
  19. </PanelBody>
  20. </Panel>
  21. );
  22. }
  23. export function NoReleaseRepos() {
  24. return (
  25. <Body>
  26. <Main fullWidth>
  27. <Panel dashedBorder>
  28. <EmptyMessage
  29. icon={<IconCommit size="xl" />}
  30. title={t('Releases are better with commit data!')}
  31. description={t('No commits associated with this release have been found.')}
  32. />
  33. </Panel>
  34. </Main>
  35. </Body>
  36. );
  37. }
  38. export function NoRepositories({orgSlug}: {orgSlug: string}) {
  39. return (
  40. <Body>
  41. <Main fullWidth>
  42. <Panel dashedBorder>
  43. <EmptyMessage
  44. icon={<IconCommit size="xl" />}
  45. title={t('Releases are better with commit data!')}
  46. description={t(
  47. 'Connect a repository to see commit info, files changed, and authors involved in future releases.'
  48. )}
  49. action={
  50. <LinkButton priority="primary" to={`/settings/${orgSlug}/repos/`}>
  51. {t('Connect a repository')}
  52. </LinkButton>
  53. }
  54. />
  55. </Panel>
  56. </Main>
  57. </Body>
  58. );
  59. }