diff --git a/app/api/actions/provider-roles.ts b/app/api/actions/provider-roles.ts index 3cfd44a..ae57e42 100644 --- a/app/api/actions/provider-roles.ts +++ b/app/api/actions/provider-roles.ts @@ -10,6 +10,7 @@ import { import { ProviderRoleDto } from '../dtos/ProviderRoleDtoSchema'; import { NewProviderRoleDto } from '../dtos/NewProviderRoleDtoSchema-Validation'; import { WorkTaskCompetencyDto } from '../dtos/WorkTaskCompetencyDtoSchema'; +import { ProviderRoleTypeWorkTaskTypeSuitabilityDto } from '../dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema'; const url = `${API_BASE_URL}/providers`; @@ -32,12 +33,25 @@ export async function getTeachers(): ActionResponsePromise { return getWithoutBody(teachersUrl); } -export async function getWorkTaskCompetencies( - providerRoleIdList: number[], +export async function patchWorkTaskSuitabilities( + updatedSuitabilities: ProviderRoleTypeWorkTaskTypeSuitabilityDto[] +) { + return patchEntityList( + updatedSuitabilities, + `${url}/workTaskTypeSuitabilityRatings` + ); +} + +export async function getWorkTaskSuitabilities( + partyIdList: number[], workTaskTypeIdList: number[] ) { - return postIntersectionTableRequest({ - idsForHasIdTypeT: providerRoleIdList, + return postIntersectionTableRequest< + number, + number, + ProviderRoleTypeWorkTaskTypeSuitabilityDto + >({ + idsForHasIdTypeT: partyIdList, idsForHasIdTypeU: workTaskTypeIdList, url: `${API_BASE_URL}/providers/workTaskCompetencies/intersectionTable` }); diff --git a/app/api/dtos/AssetRoleWorkTaskSuitabilityDtoSchema.ts b/app/api/dtos/AssetRoleWorkTaskSuitabilityDtoSchema.ts index 2e85bcf..055bd68 100644 --- a/app/api/dtos/AssetRoleWorkTaskSuitabilityDtoSchema.ts +++ b/app/api/dtos/AssetRoleWorkTaskSuitabilityDtoSchema.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; export const AssetRoleWorkTaskSuitabilityDtoSchema = z.object({ id: z.number(), - suitabilityRating: z.number(), + rating: z.number(), assetRoleTypeName: z.string(), assetRoleTypeId: z.number(), workTaskTypeName: z.string(), diff --git a/app/api/dtos/ProductDtoSchema.ts b/app/api/dtos/ProductDtoSchema.ts index ec8656a..4e5a4a2 100644 --- a/app/api/dtos/ProductDtoSchema.ts +++ b/app/api/dtos/ProductDtoSchema.ts @@ -10,6 +10,5 @@ export const ProductDtoSchema = z.object({ physicalAttributesWeight: z.number(), productTypeId: z.number(), productTypeName: z.string(), - productComponentIds: z.array(z.number()), }); export type ProductDto = z.infer; \ No newline at end of file diff --git a/app/api/dtos/ProviderRoleDtoSchema.ts b/app/api/dtos/ProviderRoleDtoSchema.ts index e80af5f..42c5a6b 100644 --- a/app/api/dtos/ProviderRoleDtoSchema.ts +++ b/app/api/dtos/ProviderRoleDtoSchema.ts @@ -1,4 +1,3 @@ -import { WorkTaskCompetencyDtoSchema } from './WorkTaskCompetencyDtoSchema'; import { z } from 'zod'; export const ProviderRoleDtoSchema = z.object({ name: z.string(), @@ -7,6 +6,5 @@ export const ProviderRoleDtoSchema = z.object({ partyId: z.number(), knowledgeDomainId: z.number(), knowledgeDomainName: z.string(), - workTaskCompetencyDtoList: z.array(WorkTaskCompetencyDtoSchema), }); export type ProviderRoleDto = z.infer; \ No newline at end of file diff --git a/app/api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema.ts b/app/api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema.ts new file mode 100644 index 0000000..275f205 --- /dev/null +++ b/app/api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +export const ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema = z.object({ + id: z.number(), + rating: z.number(), + partyId: z.number(), + workTaskType: z.string(), + workTaskTypeId: z.number(), +}); +export type ProviderRoleTypeWorkTaskTypeSuitabilityDto = z.infer; \ No newline at end of file diff --git a/app/api/dtos/WorkTaskCompetencyDtoSchema.ts b/app/api/dtos/WorkTaskCompetencyDtoSchema.ts index a9e84b9..99feb75 100644 --- a/app/api/dtos/WorkTaskCompetencyDtoSchema.ts +++ b/app/api/dtos/WorkTaskCompetencyDtoSchema.ts @@ -1,8 +1,8 @@ import { z } from 'zod'; export const WorkTaskCompetencyDtoSchema = z.object({ id: z.number(), - competencyRating: z.number(), - providerRoleId: z.number(), + rating: z.number(), + partyRoleId: z.number(), workTaskType: z.string(), workTaskTypeId: z.number(), }); diff --git a/app/api/dtos/WorkTaskDtoSchema.ts b/app/api/dtos/WorkTaskDtoSchema.ts index 7c45797..c073df9 100644 --- a/app/api/dtos/WorkTaskDtoSchema.ts +++ b/app/api/dtos/WorkTaskDtoSchema.ts @@ -6,14 +6,10 @@ export const WorkTaskDtoSchema = z.object({ events: z.array(EventDtoSchema), dueDate: z.date(), serviceProductSeriesSchemaId: z.number(), - serviceProductSeriesSchemaName: z.string(), - serviceProductTypeDto: WorkTaskTypeDtoSchema, + workProjectSeriesSchemaName: z.string(), + workTaskTypeDto: WorkTaskTypeDtoSchema, taskLength: z.number(), - targetAssetId: z.number(), - targetAssetName: z.string(), - targetAssetTypeName: z.string(), completedDate: z.date(), - customerOrderNumber: z.number(), notes: z.string(), }); export type WorkTaskDto = z.infer; \ No newline at end of file diff --git a/app/api/main.ts b/app/api/main.ts index 2485f20..6fd24de 100644 --- a/app/api/main.ts +++ b/app/api/main.ts @@ -62,6 +62,4 @@ export interface IntersectionRequestParams { url: string; } -export interface IdReferencedIntersectionTableDto { - table: StringMap; -} +export interface IdReferencedIntersectionTableDto extends StringMap {} diff --git a/app/contexts/selective-context/selective-context-creators.ts b/app/contexts/selective-context/selective-context-creators.ts index fa68db2..8155b75 100644 --- a/app/contexts/selective-context/selective-context-creators.ts +++ b/app/contexts/selective-context/selective-context-creators.ts @@ -1,8 +1,9 @@ import { createSelectiveContext } from '../../selective-context/components/base/generic-selective-context-creator'; import { AssetRoleWorkTaskSuitabilityDto } from '../../api/dtos/AssetRoleWorkTaskSuitabilityDtoSchema'; import { WorkTaskCompetencyDto } from '../../api/dtos/WorkTaskCompetencyDtoSchema'; +import { ProviderRoleTypeWorkTaskTypeSuitabilityDto } from '../../api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema'; export const AssetSuitabilityListSelectiveContext = createSelectiveContext(); export const WorkTaskCompetencyListSelectiveContext = - createSelectiveContext(); + createSelectiveContext(); diff --git a/app/premises/asset-suitability-edit-context-provider.tsx b/app/premises/asset-suitability-edit-context-provider.tsx index 8331e87..7c25981 100644 --- a/app/premises/asset-suitability-edit-context-provider.tsx +++ b/app/premises/asset-suitability-edit-context-provider.tsx @@ -41,6 +41,7 @@ export default function AssetSuitabilityEditContextProvider({ useRatingListDispatchHook: useAssetSuitabilityListDispatch, unsavedChangesKey: UnsavedAssetChanges, unsavedChangesListKey: UnsavedAssetChanges, + ratingListAccessor: selectiveContextReadAll, ...AssetSuitabilityAccessorFunctions }} > @@ -66,4 +67,4 @@ export const UnsavedAssetChangesListenerKey = 'asset-suitability-edit-context'; const suitabilityProducer = getCurriedProducer< AssetRoleWorkTaskSuitabilityDto, number ->((rating, value) => (rating.suitabilityRating = value)); +>((rating, value) => (rating.rating = value)); diff --git a/app/premises/classroom-suitability/page.tsx b/app/premises/classroom-suitability/page.tsx index b197034..efdd5ab 100644 --- a/app/premises/classroom-suitability/page.tsx +++ b/app/premises/classroom-suitability/page.tsx @@ -81,7 +81,7 @@ export default async function Page({ return Suitabilities not found.; } - const { table } = assetSuitabilities; + const table = assetSuitabilities; console.log('rendering root page'); diff --git a/app/premises/classroom-suitability/rating-table-accessor-functions.ts b/app/premises/classroom-suitability/rating-table-accessor-functions.ts index acc6275..0770176 100644 --- a/app/premises/classroom-suitability/rating-table-accessor-functions.ts +++ b/app/premises/classroom-suitability/rating-table-accessor-functions.ts @@ -13,7 +13,7 @@ import { HasUuidDto } from '../../api/dtos/HasUuidDtoSchema'; export const assetRoleWorkTaskSuitabilityRatingValueAccessor: RatingValueAccessor< AssetRoleWorkTaskSuitabilityDto -> = (wtcDto) => wtcDto.suitabilityRating; +> = (wtcDto) => wtcDto.rating; export const assetRoleWorkTaskSuitabilityLabelAccessor: RatingCategoryLabelAccessor< AssetRoleWorkTaskSuitabilityDto > = (wtcDto) => wtcDto.workTaskTypeName; @@ -23,11 +23,6 @@ export const assetRoleWorkTaskSuitabilityIdAccessor: RatingCategoryIdAccessor< export const assetNameAccessor: NameAccessor = (assetDto) => assetDto.name; -export const assetRoleWorkTaskSuitabilityDtoListAccessor: RatingListAccessor< - AssetDto, - AssetRoleWorkTaskSuitabilityDto -> = (asset) => asset.assetRoleWorkTaskSuitabilities; - export function IdAccessor(element: T) { return element.id; } @@ -47,7 +42,6 @@ export type AccessorKeys = keyof typeof StringMapKeyAccessors; export const AssetSuitabilityAccessorFunctions = { elementLabelAccessor: assetNameAccessor, - ratingListAccessor: assetRoleWorkTaskSuitabilityDtoListAccessor, ratingCategoryLabelAccessor: assetRoleWorkTaskSuitabilityLabelAccessor, ratingValueAccessor: assetRoleWorkTaskSuitabilityRatingValueAccessor, ratingCategoryIdAccessor: assetRoleWorkTaskSuitabilityIdAccessor, diff --git a/app/staffroom/contexts/providerRoles/provider-role-skill-edit-context-provider.tsx b/app/staffroom/contexts/providerRoles/provider-role-skill-edit-context-provider.tsx index a4b4075..0a223f6 100644 --- a/app/staffroom/contexts/providerRoles/provider-role-skill-edit-context-provider.tsx +++ b/app/staffroom/contexts/providerRoles/provider-role-skill-edit-context-provider.tsx @@ -15,15 +15,12 @@ import { getCurriedProducer } from './get-curried-producer'; import { UnsavedProviderRoleChanges } from './provider-role-string-map-context-creator'; import { useSelectiveContextListenerReadAll } from '../../../selective-context/components/base/generic-selective-context-creator'; import { WorkTaskCompetencyListSelectiveContext } from '../../../contexts/selective-context/selective-context-creators'; +import { ProviderRoleTypeWorkTaskTypeSuitabilityDto } from '../../../api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema'; -const skillProducer = getCurriedProducer( - (task, value) => (task.competencyRating = value) -); - -const skillListProducer = getCurriedProducer< - ProviderRoleDto, - WorkTaskCompetencyDto[] ->((providerRole, list) => (providerRole.workTaskCompetencyDtoList = list)); +const skillProducer = getCurriedProducer< + ProviderRoleTypeWorkTaskTypeSuitabilityDto, + number +>((task, value) => (task.rating = value)); export default function ProviderRoleSkillEditContextProvider({ children @@ -39,7 +36,6 @@ export default function ProviderRoleSkillEditContextProvider({ selectiveContextReadAll, workTaskCompetencyIdAccessor, skillProducer, - skillListProducer, IdStringFromNumberAccessor, UnsavedProviderRoleChanges, 'edit-context-provider' @@ -53,6 +49,7 @@ export default function ProviderRoleSkillEditContextProvider({ ratingProducer: skillProducer, unsavedChangesKey: UnsavedProviderRoleChanges, unsavedChangesListKey: UnsavedProviderRoleChanges, + ratingListAccessor: selectiveContextReadAll, ...SkillEditAccessorFunctions }} > diff --git a/app/staffroom/contexts/providerRoles/provider-role-string-map-context-provider.tsx b/app/staffroom/contexts/providerRoles/provider-role-string-map-context-provider.tsx index 013b098..6e04fb2 100644 --- a/app/staffroom/contexts/providerRoles/provider-role-string-map-context-provider.tsx +++ b/app/staffroom/contexts/providerRoles/provider-role-string-map-context-provider.tsx @@ -5,7 +5,10 @@ import { WriteableStringMapContextProvider } from '../../../contexts/string-map- import { StringMap } from '../../../contexts/string-map-context/string-map-reducer'; import { PropsWithChildren, useCallback } from 'react'; import { WorkTaskCompetencyListSelectiveContext } from '../../../contexts/selective-context/selective-context-creators'; -import { updateTeachers } from '../../../api/actions/provider-roles'; +import { + patchWorkTaskSuitabilities, + updateTeachers +} from '../../../api/actions/provider-roles'; import { ProviderChangesProviderListener, ProviderRoleStringMapContext, @@ -26,20 +29,14 @@ export default function ProviderRoleStringMapContextProvider({ const commitServerAction = useCallback( (changedProviderRoleDtoList: ProviderRoleDto[]) => { - const providerRoleDtoListWithUpdatedRatingLists = - changedProviderRoleDtoList.map((providerRoleDto) => { - const updatedList = selectiveContextReadAll( - providerRoleDto.id.toString() - ); - - return { - ...providerRoleDto, - workTaskCompetencyDtoList: isNotUndefined(updatedList) - ? updatedList - : providerRoleDto.workTaskCompetencyDtoList - }; - }); - return updateTeachers(providerRoleDtoListWithUpdatedRatingLists); + const updateLists = changedProviderRoleDtoList + .map((providerRoleDto) => { + return selectiveContextReadAll(providerRoleDto.id.toString()); + }) + .filter(isNotUndefined) + .reduce((prev, curr) => [...prev, ...curr], []); + patchWorkTaskSuitabilities(updateLists); + return updateTeachers(changedProviderRoleDtoList); }, [selectiveContextReadAll] ); diff --git a/app/staffroom/layout.tsx b/app/staffroom/layout.tsx index 8804c70..3809ad5 100644 --- a/app/staffroom/layout.tsx +++ b/app/staffroom/layout.tsx @@ -47,14 +47,6 @@ export default async function StaffroomLayout({ if (data) availabilityMap.set(providerRoleDto.id, data); } - teacherList.forEach( - (teacher) => - (teacher.workTaskCompetencyDtoList = - teacher.workTaskCompetencyDtoList.sort((wtt1, wtt2) => - wtt1.workTaskType.localeCompare(wtt2.workTaskType) - )) - ); - const providerRoleStringMap = convertListToStringMap( teacherList, IdStringFromNumberAccessor diff --git a/app/staffroom/teachers/provider-role-disclosure-list-panel/provider-role-label.tsx b/app/staffroom/teachers/provider-role-disclosure-list-panel/provider-role-label.tsx index 82d73b4..71d0be3 100644 --- a/app/staffroom/teachers/provider-role-disclosure-list-panel/provider-role-label.tsx +++ b/app/staffroom/teachers/provider-role-disclosure-list-panel/provider-role-label.tsx @@ -17,7 +17,7 @@ import { StandardTooltipContent } from '../../../generic/components/tooltips/sta import { useAssetSuitabilityStringMapContext } from '../../../premises/asset-suitability-context-creator'; import { IdStringFromNumberAccessor } from '../../../premises/classroom-suitability/rating-table-accessor-functions'; import { useAssetSuitabilityListController } from '../../../contexts/selective-context/asset-suitability-list-selective-context-provider'; -import { useWorkTaskCompetencyListStringMapContext } from '../skills/work-task-competency-context-creator'; +import { useProviderRoleTypeWorkTaskTypeSuitabilityListStringMapContext } from '../skills/work-task-competency-context-creator'; export function ProviderRoleLabel({ data: { partyName, knowledgeDomainName, id }, @@ -32,10 +32,10 @@ export function ProviderRoleLabel({ const { setHslaColorState } = useContext(HslColorDispatchContext); const hslaColorState = useContext(HslColorContext); - const { workTaskCompetencyListStringMap } = - useWorkTaskCompetencyListStringMapContext(); + const { providerRoleTypeWorkTaskTypeSuitabilityListStringMap } = + useProviderRoleTypeWorkTaskTypeSuitabilityListStringMapContext(); const workTaskCompetencyStringMapElement = - workTaskCompetencyListStringMap[id.toString()]; + providerRoleTypeWorkTaskTypeSuitabilityListStringMap[id.toString()]; const stringMapFromContext = useRef(workTaskCompetencyStringMapElement); const contextKey = useMemo(() => `${id}`, [id]); diff --git a/app/staffroom/teachers/skills/page.tsx b/app/staffroom/teachers/skills/page.tsx index 70e491b..0de3e11 100644 --- a/app/staffroom/teachers/skills/page.tsx +++ b/app/staffroom/teachers/skills/page.tsx @@ -7,7 +7,7 @@ import { EmptyArray, isNotUndefined } from '../../../api/main'; import ProviderRoleSkillEditContextProvider from '../../contexts/providerRoles/provider-role-skill-edit-context-provider'; import { getTeachers, - getWorkTaskCompetencies + getWorkTaskSuitabilities } from '../../../api/actions/provider-roles'; import { getWorkTaskTypeIdsAlphabetical } from '../../../premises/classroom-suitability/get-work-task-type-ids-alphabetical'; import { DataNotFoundCard } from '../../../timetables/students/[schedule]/data-not-found-card'; @@ -51,7 +51,7 @@ export default async function SkillsPage({ ); const providerRoleIds = Object.keys(providerRoleStringMap).map(parseTen); - const { data: workTaskCompetencies } = await getWorkTaskCompetencies( + const { data: workTaskCompetencies } = await getWorkTaskSuitabilities( providerRoleIds, workTaskTypeIdsAlphabetical ); @@ -64,7 +64,7 @@ export default async function SkillsPage({ return ( = (wtcDto) => wtcDto.competencyRating; + ProviderRoleTypeWorkTaskTypeSuitabilityDto +> = (wtcDto) => wtcDto.rating; export const workTaskCompetencyLabelAccessor: RatingCategoryLabelAccessor< - WorkTaskCompetencyDto + ProviderRoleTypeWorkTaskTypeSuitabilityDto > = (wtcDto) => wtcDto.workTaskType; export const workTaskCompetencyIdAccessor: RatingCategoryIdAccessor< - WorkTaskCompetencyDto + ProviderRoleTypeWorkTaskTypeSuitabilityDto > = (wtcDto) => wtcDto.workTaskTypeId; export const providerRoleNameAccessor: NameAccessor = ( providerRole ) => providerRole.partyName; -export const workTaskCompetencyDtoListAccessor: RatingListAccessor< - ProviderRoleDto, - WorkTaskCompetencyDto -> = (pRole) => pRole.workTaskCompetencyDtoList; const providerRoleIdAccessor = (pr: ProviderRoleDto) => pr.id; export const SkillEditAccessorFunctions = { elementLabelAccessor: providerRoleNameAccessor, - ratingListAccessor: workTaskCompetencyDtoListAccessor, ratingCategoryLabelAccessor: workTaskCompetencyLabelAccessor, ratingValueAccessor: workTaskCompetencyRatingAccessor, ratingCategoryIdAccessor: workTaskCompetencyIdAccessor, diff --git a/app/staffroom/teachers/skills/work-task-competency-context-creator.ts b/app/staffroom/teachers/skills/work-task-competency-context-creator.ts index 3b18f75..e7b564d 100644 --- a/app/staffroom/teachers/skills/work-task-competency-context-creator.ts +++ b/app/staffroom/teachers/skills/work-task-competency-context-creator.ts @@ -3,22 +3,24 @@ import { createStringMapContext } from '../../../contexts/string-map-context/context-creator'; import { useContext } from 'react'; import { WorkTaskCompetencyDto } from '../../../api/dtos/WorkTaskCompetencyDtoSchema'; +import { ProviderRoleTypeWorkTaskTypeSuitabilityDto } from '../../../api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema'; export const { - mapContext: WorkTaskCompetencyListContext, - dispatchContext: WorkTaskCompetencyListDispatchContext -} = createStringMapContext(); + mapContext: ProviderRoleTypeWorkTaskTypeSuitabilityListContext, + dispatchContext: ProviderRoleTypeWorkTaskTypeSuitabilityListDispatchContext +} = createStringMapContext(); -export function useWorkTaskCompetencyListStringMapContext() { - const workTaskCompetencyListStringMap = useContext( - WorkTaskCompetencyListContext +export function useProviderRoleTypeWorkTaskTypeSuitabilityListStringMapContext() { + const stringMap = useContext( + ProviderRoleTypeWorkTaskTypeSuitabilityListContext ); - const workTaskCompetencyListStringMapDispatch = useContext( - WorkTaskCompetencyListDispatchContext + const stringMapDispatch = useContext( + ProviderRoleTypeWorkTaskTypeSuitabilityListDispatchContext ); return { - workTaskCompetencyListStringMap, - workTaskCompetencyListStringMapDispatch + providerRoleTypeWorkTaskTypeSuitabilityListStringMap: stringMap, + providerRoleTypeWorkTaskTypeSuitabilityListStringMapDispatch: + stringMapDispatch }; } diff --git a/app/staffroom/teachers/skills/work-task-competency-context-provider.tsx b/app/staffroom/teachers/skills/work-task-competency-context-provider.tsx index e0ae56d..86e0b4c 100644 --- a/app/staffroom/teachers/skills/work-task-competency-context-provider.tsx +++ b/app/staffroom/teachers/skills/work-task-competency-context-provider.tsx @@ -10,34 +10,39 @@ import { parseTen } from '../../../api/date-and-time'; import { ProviderRoleSelectionList } from '../provider-role-disclosure-list-panel/provider-role-button-cluster'; import { WorkTaskCompetencyDto } from '../../../api/dtos/WorkTaskCompetencyDtoSchema'; import { - WorkTaskCompetencyListContext, - WorkTaskCompetencyListDispatchContext + ProviderRoleTypeWorkTaskTypeSuitabilityListContext, + ProviderRoleTypeWorkTaskTypeSuitabilityListDispatchContext } from './work-task-competency-context-creator'; +import { ProviderRoleTypeWorkTaskTypeSuitabilityDto } from '../../../api/dtos/ProviderRoleTypeWorkTaskTypeSuitabilityDtoSchema'; -export interface WorkTaskCompetencyListContextProviderProps +export interface ProviderRoleTypeWorkTaskTypeSuitabilityListContextProviderProps extends PropsWithChildren { - competencyLists: StringMap; + competencyLists: StringMap; } -const Provider = StringMapContextProvider; +const Provider = StringMapContextProvider< + ProviderRoleTypeWorkTaskTypeSuitabilityDto[] +>; export const WorkTaskCompetencyListKeyAccessor: AccessorFunction< - WorkTaskCompetencyDto[], + ProviderRoleTypeWorkTaskTypeSuitabilityDto[], string > = (workTaskCompetencyList) => { - return workTaskCompetencyList[0]?.providerRoleId.toString(); + return workTaskCompetencyList[0]?.partyId.toString(); }; export default function WorkTaskCompetencyStringMapContextProvider({ children, competencyLists -}: WorkTaskCompetencyListContextProviderProps) { +}: ProviderRoleTypeWorkTaskTypeSuitabilityListContextProviderProps) { return ( {children}