"feat: 改进 Markdown 渲染布局与工具提示组件,新增 kevisual 平台文档"

This commit is contained in:
2025-06-03 17:15:05 +08:00
parent 0847751125
commit 63d21d6614
13 changed files with 171 additions and 18 deletions

View File

@@ -1,12 +1,12 @@
import { Tooltip as UITooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import React from 'react';
export const Tooltip = (props: { children?: React.ReactNode; title?: React.ReactNode; placement?: 'top' | 'bottom' | 'left' | 'right' }) => {
export const Tooltip = (props: { children?: React.ReactNode; title?: React.ReactNode }) => {
return (
<TooltipProvider>
<UITooltip>
<TooltipTrigger asChild>{props.children}</TooltipTrigger>
<TooltipContent className='bg-gray-800 text-white' side={props.placement || 'top'}>
<TooltipContent>
<p>{props.title}</p>
</TooltipContent>
</UITooltip>

View File

@@ -0,0 +1,2 @@
img {
}

View File

@@ -0,0 +1,16 @@
import { cn } from '@/lib/utils';
// import './Preview.css';
type Props = {
children?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
[key: string]: any; // Allow any additional props
};
export const MarkdownPreview = (props: Props) => {
return (
<div className={cn('markdown-body scrollbar h-full overflow-auto px-6 py-2 max-w-[800px] border my-4 flex flex-col justify-self-center rounded-md shadow-md', props.className)} style={props.style}>
{props.children}
</div>
);
};