Path: blob/master/src/packages/frontend/components/mark-all.tsx
1503 views
/*1* This file is part of CoCalc: Copyright © 2023 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { capitalize } from "@cocalc/util/misc";6import { Button } from "antd";7import { SizeType } from "antd/lib/config-provider/SizeContext";8import { Icon } from "./icon";910interface Props {11how: string;12onClick: (how: string) => void;13size?: SizeType;14}1516export function MarkAll({ how, onClick, size }: Props) {17function icon() {18switch (how) {19case "read":20case "seen":21return <Icon name="check-square" />;22case "unread":23case "unseen":24return <Icon name="square" />;25default:26undefined;27}28}2930return (31<Button32onClick={(e) => {33e.preventDefault();34e.stopPropagation();35onClick(how);36}}37size={size}38>39<>40{icon()} Mark all {capitalize(how)}41</>42</Button>43);44}454647