import React from 'react'; import { useMedia } from 'react-use'; import { ChevronRightIcon } from '@100mslive/react-icons'; import { Flex } from '../../../Layout'; import { Text } from '../../../Text'; import { config as cssConfig } from '../../../Theme'; import { useRoomLayoutHeader } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; import { useSheetToggle } from '../AppData/useSheet'; // @ts-ignore import { useSidepaneToggle } from '../AppData/useSidepane'; import { SHEET_OPTIONS, SIDE_PANE_OPTIONS } from '../../common/constants'; export const RoomDetailsHeader = () => { const { title, description } = useRoomLayoutHeader(); const isMobile = useMedia(cssConfig.media.md); const clipLength = 30; const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS); const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS); if ((!title && !description) || (isMobile && !title)) { return null; } return ( {title} {!isMobile && ( {description.slice(0, clipLength)} {description.length > clipLength ? (  ...more ) : null} )} {isMobile && description ? ( ) : null} ); };