import Image from "next/image"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { useUserSettingsContext } from "@/lib/context/UserSettingsProvider/hooks/useUserSettingsContext"; import styles from "./CurrentBrain.module.scss"; import { Icon } from "../ui/Icon/Icon"; interface CurrentBrainProps { allowingRemoveBrain: boolean; } export const CurrentBrain = ({ allowingRemoveBrain, }: CurrentBrainProps): JSX.Element => { const { currentBrain, setCurrentBrainId } = useBrainContext(); const { isDarkMode } = useUserSettingsContext(); const removeCurrentBrain = (): void => { setCurrentBrainId(null); }; if (!currentBrain) { return <>; } return (
Talking to
logo_image {currentBrain.name}
{allowingRemoveBrain && (
{ event.nativeEvent.stopImmediatePropagation(); removeCurrentBrain(); }} >
)}
); };