import { X } from "@styled-icons/feather"; import styles from "./ChannelInfo.module.scss"; import Modal from "../../../components/ui/Modal"; import { getChannelName } from "../../revoltjs/util"; import Markdown from "../../../components/markdown/Markdown"; import { useChannel, useForceUpdate } from "../../revoltjs/hooks"; interface Props { channel_id: string; onClose: () => void; } export function ChannelInfo({ channel_id, onClose }: Props) { const ctx = useForceUpdate(); const channel = useChannel(channel_id, ctx); if (!channel) return null; if (channel.channel_type === "DirectMessage" || channel.channel_type === 'SavedMessages') { onClose(); return null; } return (

{ getChannelName(ctx.client, channel, true) }

); }