Skip to content

Commit

Permalink
feat: add loading spinner to code block client component
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Jan 28, 2025
1 parent 10c2cfe commit 1450965
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/src/components/codeblock/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { useState, useEffect, type ReactNode } from "react";

import { cn } from "@/utils/cn";
import { FileIcon } from "lucide-react";
import { FileIcon, Loader } from "lucide-react";
import CopyToClipboardBtn from "./copyToClipboard";
import { Languages } from "./languages";

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

0 comments on commit 1450965

Please sign in to comment.