Skip to content

Commit 1450965

Browse files
committed
feat: add loading spinner to code block client component
1 parent 10c2cfe commit 1450965

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

website/src/components/codeblock/client.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { useState, useEffect, type ReactNode } from "react";
1111

1212
import { cn } from "@/utils/cn";
13-
import { FileIcon } from "lucide-react";
13+
import { FileIcon, Loader } from "lucide-react";
1414
import CopyToClipboardBtn from "./copyToClipboard";
1515
import { Languages } from "./languages";
1616

@@ -88,7 +88,9 @@ const CodeblockClient = ({ lang = "tsx", ...props }: CodeHighlightProps) => {
8888
</div>
8989
</div>
9090
{isLoading ? (
91-
<div>Loading...</div>
91+
<div className="flex items-center justify-center py-3">
92+
<Loader size={16} className="animate-spin text-neutral-500" />
93+
</div>
9294
) : (
9395
<div
9496
className="overflow-y-auto bg-transparent"

0 commit comments

Comments
 (0)