/* eslint-disable react-hooks/rules-of-hooks */ import { API } from "revolt.js"; import styles from "./Embed.module.scss"; import { useClient } from "../../../../controllers/client/ClientController"; import { modalController } from "../../../../controllers/modals/ModalController"; interface Props { embed: API.Embed; width?: number; height: number; } export default function EmbedMedia({ embed, width, height }: Props) { if (embed.type !== "Website") return null; const client = useClient(); switch (embed.special?.type) { case "YouTube": { let timestamp = ""; if (embed.special.timestamp) { timestamp = `&start=${embed.special.timestamp}`; } return (