Skip to content

Commit

Permalink
Improved UI a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-hanzal committed Jan 31, 2025
1 parent 5190f16 commit 7757cdd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/pico/src/@routes/$locale/apps/derivean/map/$mapId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ export const Route = createFileRoute("/$locale/apps/derivean/map/$mapId")({
.whereRef("p.buildingId", "=", "bg.id")
.as("production");
},
(eb) => {
return eb
.selectFrom("Transport as t")
.select((eb) =>
eb.fn.count<number>("t.id").as("transport"),
)
.whereRef("t.targetId", "=", "bg.id")
.as("transport");
},
"bl.name",
"bg.x",
"bg.y",
Expand Down Expand Up @@ -316,6 +325,8 @@ export const Route = createFileRoute("/$locale/apps/derivean/map/$mapId")({
x: z.number(),
y: z.number(),

transport: z.number(),

valid: withBoolSchema(),
}),
});
Expand All @@ -336,6 +347,8 @@ export const Route = createFileRoute("/$locale/apps/derivean/map/$mapId")({
className: tvc(
NodeCss,
building.valid ? undefined : ["border-red-500"],
building.production ? ["border-purple-500"] : undefined,
building.transport > 0 ? ["border-green-500"] : undefined,
),
extent: "parent",
parentId: building.landId,
Expand Down

0 comments on commit 7757cdd

Please sign in to comment.