) => {
+ e.preventDefault()
+ await navigator.clipboard.writeText(preRef.current?.innerText ?? '')
+ setCopied(true)
+ setTimeout(() => setCopied(false), 1000)
+ }
+
+ return (
+
+
+ {children}
+
+ )
+}
\ No newline at end of file
diff --git a/components/ui/Comments.tsx b/components/ui/Comments.tsx
index f90df4f..d52e060 100644
--- a/components/ui/Comments.tsx
+++ b/components/ui/Comments.tsx
@@ -205,7 +205,7 @@ type CommentsProps = {
comments?: any
}
-export default function Comments({slug, comments}: CommentsProps) {
+export function Comments({slug, comments}: CommentsProps) {
return (
diff --git a/lib/spotify.ts b/lib/spotify.ts
index b5dd0ae..6b7f334 100644
--- a/lib/spotify.ts
+++ b/lib/spotify.ts
@@ -45,13 +45,8 @@ export const getCurrentlyPlaying = async () => {
export const getRecentlyPlayed = async () => {
- try {
- const {access_token}: Response = await getAccessToken() as Response
- } catch(e) {
- console.error(e)
- return null
- }
-
+ const {access_token}: Response = await getAccessToken() as Response
+
return await fetch(SPOTIFY_RECENTLY_PLAYED, {
headers: {
Authorization: `Bearer ${access_token}`
diff --git a/mdx-components.tsx b/mdx-components.tsx
index 4c2e529..f6bcbbf 100644
--- a/mdx-components.tsx
+++ b/mdx-components.tsx
@@ -1,4 +1,6 @@
import type {MDXComponents} from 'mdx/types'
+import React from 'react'
+import {Code} from '@/components/ui/Code'
import {Heading} from './components/ui/Heading'
// This file allows you to provide custom React components
@@ -11,6 +13,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
h2: ({children}) => {children},
h3: ({children}) => {children},
+ pre: ({children}) => {children}
,
// Allows customizing built-in components, e.g. to add styling.
// h1: ({ children }) => {children}
,
...components