First commit
Some checks failed
Main / changes (push) Successful in 34s
Main / deploy (push) Has been cancelled
Main / build-and-test (push) Has been cancelled

This commit is contained in:
2026-07-17 12:28:28 -05:00
commit 9d9cdbaebc
183 changed files with 9015 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import { Profile } from "../profiles/Profile.interface";
import { Skill } from "../skills/Skill.interface";
import { ExperienceFormState } from "./ExperienceFormState.interface"
type Action =
| { type: 'SET_ERROR'; payload: string | undefined }
| { type: 'SET_IS_DISABLED'; payload: boolean }
| { type: 'SET_IS_LOADING'; payload: boolean }
| { type: 'SET_PROFILE_OPTIONS'; payload: Profile[] }
| { type: 'SET_SKILL_OPTIONS'; payload: Skill[] | undefined };
export const initialState: ExperienceFormState = {
error: undefined,
isDisabled: false,
isLoading: true,
profileOptions: [],
skillOptions: []
};
export const reducer = (
state: ExperienceFormState,
action: Action
): ExperienceFormState => {
switch (action.type) {
case 'SET_ERROR': {
return {
...state,
error: action.payload
};
}
case 'SET_IS_DISABLED': {
return {
...state,
isDisabled: action.payload
};
}
case 'SET_IS_LOADING': {
return {
...state,
isLoading: action.payload
};
}
case 'SET_PROFILE_OPTIONS': {
return {
...state,
profileOptions: action.payload
}
}
case 'SET_SKILL_OPTIONS': {
return {
...state,
skillOptions: action.payload
}
}
default: {
return state;
}
}
};