mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 08:29:07 +08:00
fix(types): correct type definition for SvgPreview.tsx.
This commit is contained in:
parent
039904c0a1
commit
de674ad550
@ -3,20 +3,18 @@ import { memo, useCallback } from 'react'
|
||||
import { useDebouncedRender } from './hooks/useDebouncedRender'
|
||||
import ImagePreviewLayout from './ImagePreviewLayout'
|
||||
import { ShadowTransparentContainer } from './styles'
|
||||
import { BasicPreviewHandles } from './types'
|
||||
import { BasicPreviewHandles, type BasicPreviewProps } from './types'
|
||||
import { renderSvgInShadowHost } from './utils'
|
||||
|
||||
interface SvgPreviewProps {
|
||||
children: string
|
||||
enableToolbar?: boolean
|
||||
className?: string
|
||||
ref?: React.RefObject<BasicPreviewHandles | null>
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 Shadow DOM 渲染 SVG
|
||||
*/
|
||||
const SvgPreview = ({ children, enableToolbar = false, className, ref }: SvgPreviewProps) => {
|
||||
const SvgPreview = ({
|
||||
children,
|
||||
enableToolbar = false,
|
||||
className,
|
||||
ref
|
||||
}: BasicPreviewProps & { ref?: React.RefObject<BasicPreviewHandles | null> } & { className?: string }) => {
|
||||
// 定义渲染函数
|
||||
const renderSvg = useCallback(async (content: string, container: HTMLDivElement) => {
|
||||
renderSvgInShadowHost(content, container)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user