Skip to content

Commit 27d2d24

Browse files
committed
Fix keys
1 parent a9bb484 commit 27d2d24

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

site/src/components/WorkspaceActions/WorkspaceActions.tsx

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,56 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
6464

6565
// A mapping of button type to the corresponding React component
6666
const buttonMapping: ButtonMapping = {
67-
[ButtonTypesEnum.update]: <UpdateButton handleAction={handleUpdate} />,
67+
[ButtonTypesEnum.update]: (
68+
<UpdateButton handleAction={handleUpdate} key={ButtonTypesEnum.update} />
69+
),
6870
[ButtonTypesEnum.updating]: (
69-
<ActionLoadingButton label={t("actionButton.updating")} />
71+
<ActionLoadingButton
72+
label={t("actionButton.updating")}
73+
key={ButtonTypesEnum.updating}
74+
/>
75+
),
76+
[ButtonTypesEnum.start]: (
77+
<StartButton handleAction={handleStart} key={ButtonTypesEnum.start} />
7078
),
71-
[ButtonTypesEnum.start]: <StartButton handleAction={handleStart} />,
7279
[ButtonTypesEnum.starting]: (
73-
<ActionLoadingButton label={t("actionButton.starting")} />
80+
<ActionLoadingButton
81+
label={t("actionButton.starting")}
82+
key={ButtonTypesEnum.starting}
83+
/>
84+
),
85+
[ButtonTypesEnum.stop]: (
86+
<StopButton handleAction={handleStop} key={ButtonTypesEnum.stop} />
7487
),
75-
[ButtonTypesEnum.stop]: <StopButton handleAction={handleStop} />,
7688
[ButtonTypesEnum.stopping]: (
77-
<ActionLoadingButton label={t("actionButton.stopping")} />
89+
<ActionLoadingButton
90+
label={t("actionButton.stopping")}
91+
key={ButtonTypesEnum.stopping}
92+
/>
7893
),
7994
[ButtonTypesEnum.deleting]: (
80-
<ActionLoadingButton label={t("actionButton.deleting")} />
95+
<ActionLoadingButton
96+
label={t("actionButton.deleting")}
97+
key={ButtonTypesEnum.deleting}
98+
/>
8199
),
82100
[ButtonTypesEnum.canceling]: (
83-
<DisabledButton label={t("disabledButton.canceling")} />
101+
<DisabledButton
102+
label={t("disabledButton.canceling")}
103+
key={ButtonTypesEnum.canceling}
104+
/>
84105
),
85106
[ButtonTypesEnum.deleted]: (
86-
<DisabledButton label={t("disabledButton.deleted")} />
107+
<DisabledButton
108+
label={t("disabledButton.deleted")}
109+
key={ButtonTypesEnum.deleted}
110+
/>
87111
),
88112
[ButtonTypesEnum.pending]: (
89-
<ActionLoadingButton label={t("disabledButton.pending")} />
113+
<ActionLoadingButton
114+
label={t("disabledButton.pending")}
115+
key={ButtonTypesEnum.pending}
116+
/>
90117
),
91118
}
92119

0 commit comments

Comments
 (0)