import { Waveform } from '@uiball/loaders'; import clsx from 'clsx'; // import React from 'react' import { useTranslation } from 'react-i18next'; import { NavLink, useLocation } from 'react-router-dom'; import { useAppSelector } from '../../../../app/store'; import EditIcon from "../../../../assets/icons/edit.svg"; type ChannelHeaderProps = { cid: number } const ChannelHeader = ({ cid }: ChannelHeaderProps) => { const { pathname } = useLocation(); const { t } = useTranslation("chat"); const { data, loginUser } = useAppSelector(store => { return { loginUser: store.authData.user, data: store.channels.byId[cid] }; }); return (

{t("welcome_channel", { name: data?.name })}

{t("welcome_desc", { name: data?.name })}

{loginUser?.is_admin && ( {t("edit_channel")} )}
); }; type Props = { context?: { id: number, isChannel: boolean, loadingMore: boolean } } const CustomHeader = ({ context }: Props) => { if (!context) return null; const { id, isChannel, loadingMore } = context; return <> {isChannel ? : null}
; }; export default CustomHeader;