Add pop-up module for the slash commands

This commit is contained in:
sabaimran
2024-07-09 19:46:17 +05:30
parent 5b69252337
commit cc22e1b013
7 changed files with 193 additions and 79 deletions

View File

@@ -99,11 +99,16 @@ interface OnlineReferenceCardProps extends OnlineReferenceData {
}
function GenericOnlineReferenceCard(props: OnlineReferenceCardProps) {
const [isHovering, setIsHovering] = useState(false);
if (!props.link) {
console.log("invalid link", props);
return null;
}
const domain = new URL(props.link).hostname;
const favicon = `https://www.google.com/s2/favicons?domain=${domain}`;
const [isHovering, setIsHovering] = useState(false);
const handleMouseEnter = () => {
console.log("mouse entered card");
setIsHovering(true);