import React from 'react'; import { Box, Icon, IconButton, Icons, Scroll, Text } from 'folds'; import { useAtomValue } from 'jotai'; import { useClientConfig } from '../../../hooks/useClientConfig'; import { RoomCard, RoomCardGrid } from '../../../components/room-card'; import { allRoomsAtom } from '../../../state/room-list/roomList'; import { RoomSummaryLoader } from '../../../components/RoomSummaryLoader'; import { Page, PageContent, PageContentCenter, PageHeader, PageHero, PageHeroSection, } from '../../../components/page'; import { RoomTopicViewer } from '../../../components/room-topic-viewer'; import * as css from './style.css'; import { useRoomNavigate } from '../../../hooks/useRoomNavigate'; import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize'; import { BackRouteHandler } from '../../../components/BackRouteHandler'; export function FeaturedRooms() { const { featuredCommunities } = useClientConfig(); const { rooms, spaces } = featuredCommunities ?? {}; const allRooms = useAtomValue(allRoomsAtom); const screenSize = useScreenSizeContext(); const { navigateSpace, navigateRoom } = useRoomNavigate(); return ( {screenSize === ScreenSize.Mobile && ( {(onBack) => ( )} )} } title="Featured by Client" subTitle="Find and explore public rooms and spaces featured by client provider." /> {spaces && spaces.length > 0 && ( Featured Spaces {spaces.map((roomIdOrAlias) => ( {(roomSummary) => ( ( )} /> )} ))} )} {rooms && rooms.length > 0 && ( Featured Rooms {rooms.map((roomIdOrAlias) => ( {(roomSummary) => ( ( )} /> )} ))} )} {((spaces && spaces.length === 0 && rooms && rooms.length === 0) || (!spaces && !rooms)) && ( No rooms or spaces featured by client provider. )} ); }