Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
seadfeng committed Aug 27, 2024
1 parent deb1ea0 commit 16545b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/frontend/shared/image-code.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"use client";
import { Skeleton } from "@/components/ui/skeleton";
import { isBrowser } from "@/lib/utils";
import dynamic from 'next/dynamic';
import Image from "next/image";
import { useEffect, useState } from "react";

const CodeCopyBtn = dynamic(() => import('@/components/shared/CodeCopyBtn'), { ssr: false })

const CodeCopyBtn = dynamic(() => import('@/components/shared/CodeCopyBtn'), { ssr: false });

const ImageCode = ({ alt, title, src, codeStr, className}: { src: string; codeStr: string; title: string; alt: string; className?: string; }) => {
const [dimensions, setDimensions] = useState<{ width: number; height: number } | null>(null);

useEffect(() => {
if (src) {
if (src && isBrowser()) {
const img = new window.Image();
img.src = src;
img.onload = () => {
Expand Down

0 comments on commit 16545b6

Please # to comment.