adding daisy ui

This commit is contained in:
2025-12-29 19:41:55 -06:00
parent d0c4fed31b
commit 835958b0c9
3 changed files with 1 additions and 28 deletions

View File

@@ -2,11 +2,8 @@ import { Alert } from "../../interfaces/Alert.interface";
export interface LogFormState {
alert: Alert | undefined;
experienceSelectedKeys: Selection;
instrumentSelectedKeys: Selection;
isDisabled: boolean;
isLoading: boolean;
landingsSelectedKeys: Selection;
pilotOptions: { key: string; label: string; }[];
selectedPilotName: string;
}

View File

@@ -3,21 +3,15 @@ import { LogFormState } from './LogFormState.interface';
type Action =
| { type: 'SET_ALERT'; payload: Alert | undefined }
| { type: 'SET_EXPERIENCE_SELECTED_KEYS'; payload: Selection }
| { type: 'SET_INSTRUMENT_SELECTED_KEYS'; payload: Selection }
| { type: 'SET_IS_DISABLED'; payload: boolean }
| { type: 'SET_IS_LOADING'; payload: boolean }
| { type: 'SET_LANDINGS_SELECTED_KEYS'; payload: Selection }
| { type: 'SET_PILOT_OPTIONS'; payload: { key: string, label: string; }[] }
| { type: 'SET_SELECTED_PILOT_NAME'; payload: string };
export const initialState: LogFormState = {
alert: undefined,
experienceSelectedKeys: new Set([]),
instrumentSelectedKeys: new Set([]),
isDisabled: false,
isLoading: true,
landingsSelectedKeys: new Set(['1']),
pilotOptions: [],
selectedPilotName: ''
};
@@ -33,36 +27,18 @@ export const reducer = (
alert: action.payload
};
}
case 'SET_EXPERIENCE_SELECTED_KEYS': {
return {
...state,
experienceSelectedKeys: action.payload
}
}
case 'SET_IS_DISABLED': {
return {
...state,
isDisabled: action.payload
};
}
case 'SET_INSTRUMENT_SELECTED_KEYS': {
return {
...state,
instrumentSelectedKeys: action.payload
}
}
case 'SET_IS_LOADING': {
return {
...state,
isLoading: action.payload
};
}
case 'SET_LANDINGS_SELECTED_KEYS': {
return {
...state,
landingsSelectedKeys: action.payload
}
}
case 'SET_PILOT_OPTIONS': {
return {
...state,

View File

@@ -195,7 +195,7 @@ const Pilots: React.FC<unknown> = () => {
<Alert
className='mb-5'
onClose={() =>
dispatch({ type: 'SET_FORM_ALERT', payload: undefined })
dispatch({ type: 'SET_ALERT', payload: undefined })
}
severity={state.alert.severity}
>