Path: blob/master/src/packages/frontend/editors/task-editor/desc-visible.tsx
1691 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/*6Summary line about what is being shown.7*/89import { plural } from "@cocalc/util/misc";10import { LocalViewStateMap } from "./types";1112interface Props {13num_visible?: number;14num_tasks?: number;15local_view_state: LocalViewStateMap;16search_desc: string;17}1819export function DescVisible({20num_visible,21num_tasks,22local_view_state,23search_desc,24}: Props) {25function render_checked() {26const v: string[] = [];27for (let type of ["done", "deleted"]) {28if (local_view_state.get(`show_${type}`)) {29v.push(type);30}31}32if (v.length === 0) {33return;34}35return (36<span style={{ color: "#666", marginLeft: "10px" }}>37Including{" "}38<b>39<i>{v.join(" and ")}</i>40</b>{" "}41tasks.42</span>43);44}4546if (num_visible == null || local_view_state == null || num_tasks == null) {47return <span />;48}49return (50<div style={{ marginTop: "12.5px", fontWeight: 500 }}>51<span style={{ color: "#666" }}>52{num_visible} matching {plural(num_visible, "task")}.53</span>54{search_desc && (55<span style={{ color: "#666", marginLeft: "10px" }}>56Tasks that match{" "}57<b>58<i>{search_desc}</i>59</b>60.61</span>62)}63{render_checked()}64</div>65);66}676869