61a1f008d0
- i18next 23->26 + react-i18next 15->17 - prettier 2->3, reformat all files - replace @fontsource/inter with @fontsource-variable/inter 5, update import path - domhandler 5->6 (aligns with transitive deps) - lint-staged 16->17
29 lines
790 B
TypeScript
29 lines
790 B
TypeScript
import { ReactNode } from 'react';
|
|
import { RoomToParents } from '../../types/matrix/room';
|
|
import { useMatrixClient } from '../hooks/useMatrixClient';
|
|
import { allRoomsAtom } from '../state/room-list/roomList';
|
|
import { useChildRoomScopeFactory, useSpaceChildren } from '../state/hooks/roomList';
|
|
|
|
type SpaceChildRoomsProviderProps = {
|
|
spaceId: string;
|
|
mDirects: Set<string>;
|
|
roomToParents: RoomToParents;
|
|
children: (rooms: string[]) => ReactNode;
|
|
};
|
|
export function SpaceChildRoomsProvider({
|
|
spaceId,
|
|
roomToParents,
|
|
mDirects,
|
|
children,
|
|
}: SpaceChildRoomsProviderProps) {
|
|
const mx = useMatrixClient();
|
|
|
|
const childRooms = useSpaceChildren(
|
|
allRoomsAtom,
|
|
spaceId,
|
|
useChildRoomScopeFactory(mx, mDirects, roomToParents),
|
|
);
|
|
|
|
return children(childRooms);
|
|
}
|