chore: images create

This commit is contained in:
jialin
2024-11-22 10:00:34 +08:00
parent c3473673da
commit dde937f460
52 changed files with 1883 additions and 941 deletions
@@ -9,6 +9,7 @@ interface CodeViewerProps {
ignoreIllegals?: boolean;
copyable?: boolean;
height?: string | number;
style?: React.CSSProperties;
}
const DarkViewer: React.FC<CodeViewerProps> = (props) => {
const {
@@ -22,6 +23,7 @@ const DarkViewer: React.FC<CodeViewerProps> = (props) => {
return (
<CodeViewer
style={props.style}
height={height}
code={code}
lang={lang}
@@ -9,6 +9,7 @@ interface CodeViewerProps {
ignoreIllegals?: boolean;
copyable?: boolean;
height?: string | number;
style?: React.CSSProperties;
}
const LightViewer: React.FC<CodeViewerProps> = (props) => {
const {
@@ -17,11 +18,13 @@ const LightViewer: React.FC<CodeViewerProps> = (props) => {
autodetect,
ignoreIllegals,
copyable,
style,
height = 'auto'
} = props || {};
return (
<CodeViewer
style={style}
height={height}
code={code}
lang={lang}
@@ -12,6 +12,7 @@ interface CodeViewerProps {
copyable?: boolean;
height?: string | number;
theme?: 'light' | 'dark';
style?: React.CSSProperties;
}
const CodeViewer: React.FC<CodeViewerProps> = (props) => {
const {
@@ -20,7 +21,8 @@ const CodeViewer: React.FC<CodeViewerProps> = (props) => {
autodetect = true,
ignoreIllegals = true,
copyable = true,
height = 'auto'
height = 'auto',
style
} = props || {};
const highlightedCode = useMemo(() => {
@@ -69,7 +71,8 @@ const CodeViewer: React.FC<CodeViewerProps> = (props) => {
}
)}
style={{
height: height
height: height,
...style
}}
>
<code
+4
View File
@@ -9,8 +9,10 @@ const HighlightCode: React.FC<{
copyable?: boolean;
theme?: 'light' | 'dark';
height?: string | number;
style?: React.CSSProperties;
}> = (props) => {
const {
style,
code,
lang = 'bash',
copyable = true,
@@ -26,9 +28,11 @@ const HighlightCode: React.FC<{
code={code}
copyable={copyable}
height={height}
style={style}
/>
) : (
<CodeViewerLight
style={style}
lang={lang}
code={code}
copyable={copyable}