+2
-2
apps/skillulator/src/routes/c/$class/components/Skill.tsx
+2
-2
apps/skillulator/src/routes/c/$class/components/Skill.tsx
···
1
+
import type { Skill as SkillType } from "../../../../types";
1
2
import { languages } from "../../../../utils/constants";
2
3
import { getLanguageForSkill } from "../../../../utils/language";
3
-
import type { State } from "../../../../zustand/treeStore";
4
4
import {
5
5
DecreaseSkillPointButton,
6
6
IncreaseSkillToMaxButton,
···
9
9
import { Requirement } from "./Requirement";
10
10
11
11
interface SkillProps {
12
-
skill: State["jobTree"][0]["skills"][0];
12
+
skill: SkillType;
13
13
jobId: number;
14
14
skillId: number;
15
15
hasMinLevelRequirements: boolean;
+9
apps/skillulator/src/types.ts
+9
apps/skillulator/src/types.ts
···
1
+
import type { State } from "./zustand/treeStore";
2
+
3
+
export type Skills = State["jobTree"][number]["skills"];
4
+
export type Skill = State["jobTree"][0]["skills"][0];
5
+
export type Jobs = State["jobTree"];
6
+
export type SkillBracket = {
7
+
maxLevel: number;
8
+
pointsPerLevel: number;
9
+
};
+1
-7
apps/skillulator/src/utils/skill-tree-helpers.ts
+1
-7
apps/skillulator/src/utils/skill-tree-helpers.ts
···
1
+
import type { Jobs, SkillBracket, Skills } from "../types";
1
2
import type { State } from "../zustand/treeStore";
2
3
import type { JOB_SKILLPOINTS } from "./constants";
3
-
4
-
type Skills = State["jobTree"][number]["skills"];
5
-
type Jobs = State["jobTree"];
6
-
type SkillBracket = {
7
-
maxLevel: number;
8
-
pointsPerLevel: number;
9
-
};
10
4
11
5
export function getJobById(jobId: number, jobs: Jobs) {
12
6
return jobs.filter((job) => job.id === jobId).at(0);