diff --git a/app/scenes/Document/components/Insights.tsx b/app/scenes/Document/components/Insights.tsx index 4504105f4..51c2de0b0 100644 --- a/app/scenes/Document/components/Insights.tsx +++ b/app/scenes/Document/components/Insights.tsx @@ -46,105 +46,114 @@ function Insights() { return ( {document ? ( - <> - - {t("Stats")} - - - {stats.total.words > 0 && ( + +
+ + {t("Stats")} + + + {stats.total.words > 0 && ( +
  • + {t(`{{ count }} minute read`, { + count: stats.total.readingTime, + })} +
  • + )}
  • - {t(`{{ count }} minute read`, { - count: stats.total.readingTime, + {t(`{{ count }} words`, { count: stats.total.words })} +
  • +
  • + {t(`{{ count }} characters`, { + count: stats.total.characters, })}
  • - )} -
  • {t(`{{ count }} words`, { count: stats.total.words })}
  • -
  • - {t(`{{ count }} characters`, { - count: stats.total.characters, - })} -
  • -
  • - {t(`{{ number }} emoji`, { number: stats.total.emoji })} -
  • - {stats.selected.characters === 0 ? ( -
  • {t("No text selected")}
  • - ) : ( - <> -
  • - {t(`{{ count }} words selected`, { - count: stats.selected.words, - })} -
  • -
  • - {t(`{{ count }} characters selected`, { - count: stats.selected.characters, - })} -
  • - - )} -
    -
    -
    - {document.insightsEnabled && ( - <> - - {t("Contributors")} - - {t(`Created`)}{" "} - - - ( - } - subtitle={ - model.id === document.createdBy.id - ? t("Creator") - : model.id === document.updatedBy.id - ? t("Last edited") - : t("Previously edited") - } - border={false} - small - /> - )} - /> - - - - {t("Views")} - - {documentViews.length <= 1 - ? t("No one else has viewed yet") - : t( - `Viewed {{ count }} times by {{ teamMembers }} people`, - { - count: documentViews.reduce( - (memo, view) => memo + view.count, - 0 - ), - teamMembers: documentViews.length, - } - )} - . - - {documentViews.length > 1 && ( +
  • + {t(`{{ number }} emoji`, { number: stats.total.emoji })} +
  • + {stats.selected.characters === 0 ? ( +
  • {t("No text selected")}
  • + ) : ( + <> +
  • + {t(`{{ count }} words selected`, { + count: stats.selected.words, + })} +
  • +
  • + {t(`{{ count }} characters selected`, { + count: stats.selected.characters, + })} +
  • + + )} + + +
    + {document.insightsEnabled && ( + <> + + {t("Contributors")} + + {t(`Created`)}{" "} + - + ( + } + subtitle={ + model.id === document.createdBy.id + ? t("Creator") + : model.id === document.updatedBy.id + ? t("Last edited") + : t("Previously edited") + } + border={false} + small + /> + )} + /> - )} - - - )} + + + {t("Views")} + + {documentViews.length <= 1 + ? t("No one else has viewed yet") + : t( + `Viewed {{ count }} times by {{ teamMembers }} people`, + { + count: documentViews.reduce( + (memo, view) => memo + view.count, + 0 + ), + teamMembers: documentViews.length, + } + )} + . + + {documentViews.length > 1 && ( + + + + )} + + + )} +
    {can.updateInsights && ( @@ -167,7 +176,7 @@ function Insights() { /> )} - +
    ) : null}
    ); @@ -200,14 +209,13 @@ function countWords(text: string): number { } const Manage = styled(Flex)` + background: ${s("background")}; border: 1px solid ${s("inputBorder")}; border-bottom-width: 2px; border-radius: 8px; margin: 16px; padding: 16px 16px 0; - - position: absolute; - bottom: 0; + justify-self: flex-end; `; const ListSpacing = styled("div")`