Files
memos/web/src/components/VisibilityIcon.tsx
gugus bb402d4ccc
Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
first commit
2026-03-04 06:30:47 +00:00

29 lines
714 B
TypeScript

import { Globe2Icon, LockIcon, UsersIcon } from "lucide-react";
import { cn } from "@/lib/utils";
import { Visibility } from "@/types/proto/api/v1/memo_service_pb";
interface Props {
visibility: Visibility;
className?: string;
}
const VisibilityIcon = (props: Props) => {
const { className, visibility } = props;
let VIcon = null;
if (visibility === Visibility.PRIVATE) {
VIcon = LockIcon;
} else if (visibility === Visibility.PROTECTED) {
VIcon = UsersIcon;
} else if (visibility === Visibility.PUBLIC) {
VIcon = Globe2Icon;
}
if (!VIcon) {
return null;
}
return <VIcon className={cn("w-4 h-auto text-muted-foreground", className)} />;
};
export default VisibilityIcon;