summaryrefslogtreecommitdiff
path: root/components/Sidebar
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-10-05 12:35:40 +0200
committerThomas F. K. Jorna <[email protected]>2021-10-05 12:35:40 +0200
commit33839479e269bed905f9eefc374060b9d3ee7e19 (patch)
treef628200a10e5e37aa00f05cea2464eaf67df9581 /components/Sidebar
parentb0ddf286f087b31dc75626f709cfce3889de25dd (diff)
feat(preview): filesystem basics in place
Diffstat (limited to 'components/Sidebar')
-rw-r--r--components/Sidebar/Link.tsx11
-rw-r--r--components/Sidebar/index.tsx5
2 files changed, 16 insertions, 0 deletions
diff --git a/components/Sidebar/Link.tsx b/components/Sidebar/Link.tsx
new file mode 100644
index 0000000..789873a
--- /dev/null
+++ b/components/Sidebar/Link.tsx
@@ -0,0 +1,11 @@
+import { Text } from '@chakra-ui/react'
+
+export interface LinkProps {
+ id: string
+}
+
+export const Link = (props: LinkProps) => {
+ const { id } = props
+
+ return <Text>{id}</Text>
+}
diff --git a/components/Sidebar/index.tsx b/components/Sidebar/index.tsx
index 05f5720..4f314da 100644
--- a/components/Sidebar/index.tsx
+++ b/components/Sidebar/index.tsx
@@ -51,6 +51,11 @@ const Sidebar = (props: SidebarProps) => {
console.log(res)
setPreviewText(res)
})
+ .catch((e) => {
+ setPreviewText(
+ 'Could not fetch the text for some reason, sorry!\n\n This can happen because you have an id with forward slashes (/) in it.',
+ )
+ })
}
useEffect(() => {