Show the error inline

This commit is contained in:
Manav Rathi
2024-10-11 19:27:49 +05:30
parent 4bf2780807
commit 71982d5557

View File

@@ -87,7 +87,7 @@ const CGroupPersonHeader: React.FC<CGroupPersonHeaderProps> = ({
renameCGroup(cgroup, name),
);
const handleDeletePerson = () =>
const handleReset = () =>
showMiniDialog({
title: pt("Reset person?"),
message: pt(
@@ -96,16 +96,14 @@ const CGroupPersonHeader: React.FC<CGroupPersonHeaderProps> = ({
continue: {
text: t("reset"),
color: "primary",
action: deletePerson,
action: async () => {
await deleteCGroup(cgroup);
// Reset the selection to the default state.
onSelectPerson(undefined);
},
},
});
const deletePerson = useWrapAsyncOperation(async () => {
await deleteCGroup(cgroup);
// Reset the selection to the default state.
onSelectPerson(undefined);
});
// While technically it is possible for the cgroup not to have a name,
// logical wise we shouldn't be ending up here without a name.
const name = cgroup.data.name ?? "";
@@ -130,7 +128,7 @@ const CGroupPersonHeader: React.FC<CGroupPersonHeaderProps> = ({
<OverflowMenuOption
startIcon={<ClearIcon />}
centerAlign
onClick={handleDeletePerson}
onClick={handleReset}
>
{pt("Reset")}
</OverflowMenuOption>