Skip to content

Commit fecb385

Browse files
committed
fix pluralization
1 parent cba48d6 commit fecb385

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

site/src/pages/TasksPage/BatchDeleteConfirmation.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ export const BatchDeleteConfirmation: FC<BatchDeleteConfirmationProps> = ({
105105
<>
106106
{stage === "consequences" && <Consequences />}
107107
{stage === "tasks" && <Tasks tasks={checkedTasks} />}
108-
{stage === "resources" && <Resources workspaces={workspaces} />}
108+
{stage === "resources" && (
109+
<Resources tasks={checkedTasks} workspaces={workspaces} />
110+
)}
109111
{resourceIconPreloads}
110112
</>
111113
}
@@ -118,6 +120,7 @@ interface TasksStageProps {
118120
}
119121

120122
interface ResourcesStageProps {
123+
tasks: readonly Task[];
121124
workspaces: readonly Workspace[];
122125
}
123126

@@ -227,7 +230,7 @@ const Tasks: FC<TasksStageProps> = ({ tasks }) => {
227230
);
228231
};
229232

230-
const Resources: FC<ResourcesStageProps> = ({ workspaces }) => {
233+
const Resources: FC<ResourcesStageProps> = ({ tasks, workspaces }) => {
231234
const resources: Record<string, { count: number; icon: string }> = {};
232235
for (const workspace of workspaces) {
233236
for (const resource of workspace.latest_build.resources) {
@@ -242,12 +245,10 @@ const Resources: FC<ResourcesStageProps> = ({ workspaces }) => {
242245
}
243246
}
244247

245-
const workspaceCount = workspaces.length;
246-
247248
return (
248249
<Stack>
249250
<p>
250-
Deleting {workspaceCount === 1 ? "this task" : "these tasks"} will also
251+
Deleting {tasks.length === 1 ? "this task" : "these tasks"} will also
251252
permanently destroy&hellip;
252253
</p>
253254
<Stack
@@ -259,7 +260,8 @@ const Resources: FC<ResourcesStageProps> = ({ workspaces }) => {
259260
<Stack direction="row" alignItems="center" spacing={1}>
260261
<ServerIcon className="size-icon-sm" />
261262
<span>
262-
{workspaceCount} {workspaceCount === 1 ? "workspace" : "workspaces"}
263+
{workspaces.length}{" "}
264+
{workspaces.length === 1 ? "workspace" : "workspaces"}
263265
</span>
264266
</Stack>
265267
{Object.entries(resources).map(([type, summary]) => (

site/src/pages/TasksPage/TasksPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { API } from "api/api";
22
import { templates } from "api/queries/templates";
33
import { workspaces } from "api/queries/workspaces";
4-
import type { Task, TasksFilter } from "api/typesGenerated";
4+
import type { TasksFilter } from "api/typesGenerated";
55
import { Badge } from "components/Badge/Badge";
66
import { Button, type ButtonProps } from "components/Button/Button";
77
import {

0 commit comments

Comments
 (0)