aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/FollowMode/FollowMode.tsx
blob: 89581bfa41f8d9d988ec32486a146094309a8d1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { UserToFollow } from "../../types";
import { CloseIcon } from "../icons";
import "./FollowMode.scss";

interface FollowModeProps {
  width: number;
  height: number;
  userToFollow: UserToFollow;
  onDisconnect: () => void;
}

const FollowMode = ({
  height,
  width,
  userToFollow,
  onDisconnect,
}: FollowModeProps) => {
  return (
    <div className="follow-mode" style={{ width, height }}>
      <div className="follow-mode__badge">
        <div className="follow-mode__badge__label">
          Following{" "}
          <span
            className="follow-mode__badge__username"
            title={userToFollow.username}
          >
            {userToFollow.username}
          </span>
        </div>
        <button
          type="button"
          onClick={onDisconnect}
          className="follow-mode__disconnect-btn"
        >
          {CloseIcon}
        </button>
      </div>
    </div>
  );
};

export default FollowMode;