DashboardSettingsHeader.tsx 690 B

12345678910111213141516171819202122232425262728
  1. import React from 'react';
  2. import { Icon, HorizontalGroup } from '@grafana/ui';
  3. type Props = {
  4. title: string;
  5. onGoBack: () => void;
  6. isEditing: boolean;
  7. };
  8. export const DashboardSettingsHeader: React.FC<Props> = ({ onGoBack, isEditing, title }) => {
  9. return (
  10. <div className="dashboard-settings__header">
  11. <HorizontalGroup align="center" justify="space-between">
  12. <h3>
  13. <span onClick={onGoBack} className={isEditing ? 'pointer' : ''}>
  14. {title}
  15. </span>
  16. {isEditing && (
  17. <span>
  18. <Icon name="angle-right" /> Edit
  19. </span>
  20. )}
  21. </h3>
  22. </HorizontalGroup>
  23. </div>
  24. );
  25. };