style: fmt code

This commit is contained in:
ReaJason
2026-04-26 21:33:15 +08:00
parent d10323a054
commit ee560ff7ee
150 changed files with 948 additions and 1522 deletions
+6 -13
View File
@@ -1,8 +1,10 @@
"use client";
import { Image, type ImageProps } from "fumadocs-core/framework";
import type { ComponentProps } from "react";
import { Image, type ImageProps } from "fumadocs-core/framework";
import Zoom, { type UncontrolledProps } from "react-medium-image-zoom";
import "@/components/image-zoom.css";
export type ImageZoomProps = ImageProps & {
@@ -22,20 +24,14 @@ function getImageSrc(src: ImageProps["src"]): string {
if (typeof src === "object") {
// Next.js
if ("default" in src)
return (src as { default: { src: string } }).default.src;
if ("default" in src) return (src as { default: { src: string } }).default.src;
return src.src;
}
return "";
}
export function ImageZoom({
zoomInProps,
children,
rmiz,
...props
}: ImageZoomProps) {
export function ImageZoom({ zoomInProps, children, rmiz, ...props }: ImageZoomProps) {
return (
<Zoom
zoomMargin={20}
@@ -48,10 +44,7 @@ export function ImageZoom({
}}
>
{children ?? (
<Image
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px"
{...props}
/>
<Image sizes="(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px" {...props} />
)}
</Zoom>
);