fix(ui): use translation for unnamed workflows

This commit is contained in:
psychedelicious 2023-12-06 23:48:12 +11:00
parent 6d176601cc
commit 6e028d691a

View File

@ -5,9 +5,7 @@ import { useTranslation } from 'react-i18next';
const TopCenterPanel = () => { const TopCenterPanel = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const name = useAppSelector( const name = useAppSelector((state) => state.workflow.name);
(state) => state.workflow.name || 'Untitled Workflow'
);
const isTouched = useAppSelector((state) => state.workflow.isTouched); const isTouched = useAppSelector((state) => state.workflow.isTouched);
return ( return (
@ -20,7 +18,7 @@ const TopCenterPanel = () => {
fontWeight={600} fontWeight={600}
opacity={0.8} opacity={0.8}
> >
{name} {name || t('workflows.unnamedWorkflow')}
{isTouched ? ` (${t('common.unsaved')})` : ''} {isTouched ? ` (${t('common.unsaved')})` : ''}
</Text> </Text>
); );