cdf352d4c3
Co-authored-by: dwelle <luzar.david@gmail.com> Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
40 lines
926 B
TypeScript
40 lines
926 B
TypeScript
import clsx from "clsx";
|
|
import { ToolButton } from "./ToolButton";
|
|
import { t } from "../i18n";
|
|
import { useDevice } from "../components/App";
|
|
import { users } from "./icons";
|
|
|
|
import "./CollabButton.scss";
|
|
|
|
const CollabButton = ({
|
|
isCollaborating,
|
|
collaboratorCount,
|
|
onClick,
|
|
}: {
|
|
isCollaborating: boolean;
|
|
collaboratorCount: number;
|
|
onClick: () => void;
|
|
}) => {
|
|
return (
|
|
<>
|
|
<ToolButton
|
|
className={clsx("CollabButton", {
|
|
"is-collaborating": isCollaborating,
|
|
})}
|
|
onClick={onClick}
|
|
icon={users}
|
|
type="button"
|
|
title={t("labels.liveCollaboration")}
|
|
aria-label={t("labels.liveCollaboration")}
|
|
showAriaLabel={useDevice().isMobile}
|
|
>
|
|
{collaboratorCount > 0 && (
|
|
<div className="CollabButton-collaborators">{collaboratorCount}</div>
|
|
)}
|
|
</ToolButton>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default CollabButton;
|