46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import { NotepadTextIcon } from "lucide-react"
|
|
import { memo } from "react"
|
|
import { useTranslation } from "react-i18next"
|
|
import { CopyButton } from "@/components/common/CopyButton"
|
|
import MarkdownBlock from "@/components/common/MarkdownBlock"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
interface PlanCompletionOutputProps {
|
|
text: string
|
|
onCopy?: () => void
|
|
headClassNames?: string
|
|
}
|
|
|
|
/**
|
|
* Styled completion output for Plan Mode responses
|
|
* Uses grayscale colors to distinguish from Act Mode's green success theme
|
|
*/
|
|
const PlanCompletionOutputRow = memo(({ text, headClassNames }: PlanCompletionOutputProps) => {
|
|
const { t } = useTranslation("common")
|
|
return (
|
|
<div className="rounded-sm border border-description/50 overflow-visible bg-code p-2 pt-3">
|
|
{/* Header */}
|
|
<div className={cn(headClassNames, "justify-between px-1")}>
|
|
<div className="flex gap-2 items-center">
|
|
<NotepadTextIcon className="size-2" />
|
|
<span className="text-foreground font-bold">{t("planCompletion.planCreated")}</span>
|
|
</div>
|
|
<CopyButton textToCopy={text || ""} />
|
|
</div>
|
|
|
|
{/* Content */}
|
|
<div className="w-full relative border-t-1 border-description/20 rounded-b-sm">
|
|
<div className="plan-completion-content p-2 pt-3 w-full [&_hr]:opacity-20 [&_p:last-child]:mb-0">
|
|
<div className="wrap-anywhere [&_hr]:opacity-20">
|
|
<MarkdownBlock markdown={text} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
})
|
|
|
|
PlanCompletionOutputRow.displayName = "PlanCompletionOutputRow"
|
|
|
|
export default PlanCompletionOutputRow
|