mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-01-16 08:21:55 +00:00
update edit method view
This commit is contained in:
parent
635db9babd
commit
d72c871716
@ -1,4 +1,4 @@
|
||||
import { Check, Edit, Loader2, X } from 'lucide-react'
|
||||
import { Check, Edit, Loader2, X, Diff } from 'lucide-react'
|
||||
import { PropsWithChildren, useState } from 'react'
|
||||
|
||||
import { useDarkModeContext } from '../../contexts/DarkModeContext'
|
||||
@ -24,7 +24,6 @@ export default function MarkdownApplyDiffBlock({
|
||||
const [applying, setApplying] = useState(false)
|
||||
const { isDarkMode } = useDarkModeContext()
|
||||
|
||||
console.log('MarkdownApplyDiffBlock', { mode, applyStatus, onApply, path, diff, finish })
|
||||
const handleApply = async () => {
|
||||
if (applyStatus !== ApplyStatus.Idle) {
|
||||
return
|
||||
@ -43,7 +42,7 @@ export default function MarkdownApplyDiffBlock({
|
||||
<div className={'infio-chat-code-block-header'}>
|
||||
{path && (
|
||||
<div className={'infio-chat-code-block-header-filename'}>
|
||||
<Edit size={10} className="infio-chat-code-block-header-icon" />
|
||||
<Diff size={10} className="infio-chat-code-block-header-icon" />
|
||||
{mode}: {path}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -57,7 +57,7 @@ export default function MarkdownEditFileBlock({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`infio-chat-code-block ${path ? 'has-filename' : ''}`}>
|
||||
<div className={`infio-chat-code-block ${path ? 'has-filename' : ''} infio-reasoning-block`}>
|
||||
<div className={'infio-chat-code-block-header'}>
|
||||
{path && (
|
||||
<div className={'infio-chat-code-block-header-filename'}>
|
||||
@ -106,14 +106,16 @@ export default function MarkdownEditFileBlock({
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<MemoizedSyntaxHighlighterWrapper
|
||||
isDarkMode={isDarkMode}
|
||||
language={language}
|
||||
hasFilename={!!path}
|
||||
wrapLines={wrapLines}
|
||||
>
|
||||
{String(children)}
|
||||
</MemoizedSyntaxHighlighterWrapper>
|
||||
<div className="infio-reasoning-content-wrapper">
|
||||
<MemoizedSyntaxHighlighterWrapper
|
||||
isDarkMode={isDarkMode}
|
||||
language={language}
|
||||
hasFilename={!!path}
|
||||
wrapLines={wrapLines}
|
||||
>
|
||||
{String(children)}
|
||||
</MemoizedSyntaxHighlighterWrapper>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { Check, Loader2, Replace, X } from 'lucide-react'
|
||||
import React, { useMemo } from 'react'
|
||||
import React from 'react'
|
||||
|
||||
import { useApp } from '../../contexts/AppContext'
|
||||
import { useDarkModeContext } from '../../contexts/DarkModeContext'
|
||||
import { ApplyStatus, SearchAndReplaceToolArgs } from '../../types/apply'
|
||||
import { openMarkdownFile } from '../../utils/obsidian'
|
||||
|
||||
import { MemoizedSyntaxHighlighterWrapper } from './SyntaxHighlighterWrapper'
|
||||
import { useDarkModeContext } from '../../contexts/DarkModeContext'
|
||||
|
||||
export default function MarkdownSearchAndReplace({
|
||||
applyStatus,
|
||||
@ -45,7 +46,7 @@ export default function MarkdownSearchAndReplace({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`infio-chat-code-block ${path ? 'has-filename' : ''}`}
|
||||
className={`infio-chat-code-block ${path ? 'has-filename' : ''} infio-reasoning-block`}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<div className={'infio-chat-code-block-header'}>
|
||||
@ -82,14 +83,16 @@ export default function MarkdownSearchAndReplace({
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<MemoizedSyntaxHighlighterWrapper
|
||||
isDarkMode={isDarkMode}
|
||||
language="markdown"
|
||||
hasFilename={!!path}
|
||||
wrapLines={true}
|
||||
>
|
||||
{content}
|
||||
</MemoizedSyntaxHighlighterWrapper>
|
||||
<div className="infio-reasoning-content-wrapper">
|
||||
<MemoizedSyntaxHighlighterWrapper
|
||||
isDarkMode={isDarkMode}
|
||||
language="markdown"
|
||||
hasFilename={!!path}
|
||||
wrapLines={true}
|
||||
>
|
||||
{content}
|
||||
</MemoizedSyntaxHighlighterWrapper>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user