diff --git a/app/scenes/Document/components/Contents.tsx b/app/scenes/Document/components/Contents.tsx
index 216fd76fa..b6cf6c4d2 100644
--- a/app/scenes/Document/components/Contents.tsx
+++ b/app/scenes/Document/components/Contents.tsx
@@ -5,7 +5,6 @@ import styled from "styled-components";
import breakpoint from "styled-components-breakpoint";
import { EditorStyleHelper } from "@shared/editor/styles/EditorStyleHelper";
import { depths, s } from "@shared/styles";
-import Text from "~/components/Text";
import useWindowScrollPosition from "~/hooks/useWindowScrollPosition";
const HEADING_OFFSET = 20;
@@ -54,26 +53,26 @@ export default function Contents({ headings }: Props) {
const headingAdjustment = minHeading - 1;
const { t } = useTranslation();
+ if (headings.length === 0) {
+ return null;
+ }
+
return (
{t("Contents")}
- {headings.length ? (
-
- {headings
- .filter((heading) => heading.level < 4)
- .map((heading) => (
-
- {heading.title}
-
- ))}
-
- ) : (
- {t("Headings you add to the document will appear here")}
- )}
+
+ {headings
+ .filter((heading) => heading.level < 4)
+ .map((heading) => (
+
+ {heading.title}
+
+ ))}
+
);
}
@@ -112,10 +111,6 @@ const Heading = styled.h3`
margin-top: 10px;
`;
-const Empty = styled(Text)`
- font-size: 14px;
-`;
-
const ListItem = styled.li<{ level: number; active?: boolean }>`
margin-left: ${(props) => (props.level - 1) * 10}px;
margin-bottom: 8px;
diff --git a/app/scenes/Document/components/Header.tsx b/app/scenes/Document/components/Header.tsx
index 79a57a717..84f2cac25 100644
--- a/app/scenes/Document/components/Header.tsx
+++ b/app/scenes/Document/components/Header.tsx
@@ -121,7 +121,13 @@ function DocumentHeader({
const canToggleEmbeds = team?.documentEmbeds;
const toc = (