mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-25 16:31:53 +08:00
style: fmt code
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user