import {Fragment} from 'react'; import EditableText from 'sentry/components/editableText'; import {t} from 'sentry/locale'; import {DashboardDetails} from './types'; type Props = { dashboard: DashboardDetails | null; isEditingDashboard: boolean; onUpdate: (dashboard: DashboardDetails) => void; }; function DashboardTitle({dashboard, isEditingDashboard, onUpdate}: Props) { return ( {!dashboard ? ( t('Dashboards') ) : ( onUpdate({...dashboard, title: newTitle})} errorMessage={t('Please set a title for this dashboard')} autoSelect /> )} ); } export default DashboardTitle;