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