mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
655 B
TypeScript
28 lines
655 B
TypeScript
import classNames from "classnames";
|
|
import { Visibility } from "@/types/proto/api/v2/memo_service";
|
|
import Icon from "./Icon";
|
|
|
|
interface Props {
|
|
visibility: Visibility;
|
|
}
|
|
|
|
const VisibilityIcon = (props: Props) => {
|
|
const { visibility } = props;
|
|
|
|
let VIcon = null;
|
|
if (visibility === Visibility.PRIVATE) {
|
|
VIcon = Icon.Lock;
|
|
} else if (visibility === Visibility.PROTECTED) {
|
|
VIcon = Icon.Users;
|
|
} else if (visibility === Visibility.PUBLIC) {
|
|
VIcon = Icon.Globe2;
|
|
}
|
|
if (!VIcon) {
|
|
return null;
|
|
}
|
|
|
|
return <VIcon className={classNames("w-4 h-auto text-gray-500 dark:text-gray-400")} />;
|
|
};
|
|
|
|
export default VisibilityIcon;
|