Unify SuccessCard for create and update tools to show only title and URL

This commit is contained in:
CREDO23 2026-02-13 13:46:47 +02:00
parent 2bbb8e6a3a
commit 254ed5ed11
2 changed files with 12 additions and 31 deletions

View file

@ -423,28 +423,27 @@ function SuccessCard({ result }: { result: SuccessResult }) {
<CheckIcon className="size-4 text-green-500" /> <CheckIcon className="size-4 text-green-500" />
</div> </div>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<p className=" text-[.8rem] text-muted-foreground"> <p className="text-[.8rem] text-muted-foreground">
{result.message || "Notion page created successfully"} {result.message || "Notion page created successfully"}
</p> </p>
</div> </div>
</div> </div>
{/* Show details to verify the arguments were used */}
<div className="space-y-2 px-4 py-3 text-xs"> <div className="space-y-2 px-4 py-3 text-xs">
<div> <div>
<span className="font-medium text-muted-foreground">Page ID: </span> <span className="font-medium text-muted-foreground">Title: </span>
<span className="font-mono">{result.page_id}</span> <span>{result.title}</span>
</div> </div>
{result.content_length != null && ( {result.url && (
<div> <div>
<span className="font-medium text-muted-foreground">Content: </span> <a
<span>{result.content_length} characters</span> href={result.url}
</div> target="_blank"
)} rel="noopener noreferrer"
{result.content_preview && ( className="text-primary hover:underline"
<div> >
<span className="font-medium text-muted-foreground">Preview: </span> Open in Notion
<span className="text-muted-foreground italic">{result.content_preview}</span> </a>
</div> </div>
)} )}
</div> </div>

View file

@ -393,19 +393,13 @@ function SuccessCard({ result }: { result: SuccessResult }) {
</div> </div>
</div> </div>
{/* Show details to verify the update */}
<div className="space-y-2 px-4 py-3 text-xs"> <div className="space-y-2 px-4 py-3 text-xs">
<div>
<span className="font-medium text-muted-foreground">Page ID: </span>
<span className="font-mono">{result.page_id}</span>
</div>
<div> <div>
<span className="font-medium text-muted-foreground">Title: </span> <span className="font-medium text-muted-foreground">Title: </span>
<span>{result.title}</span> <span>{result.title}</span>
</div> </div>
{result.url && ( {result.url && (
<div> <div>
<span className="font-medium text-muted-foreground">URL: </span>
<a <a
href={result.url} href={result.url}
target="_blank" target="_blank"
@ -416,18 +410,6 @@ function SuccessCard({ result }: { result: SuccessResult }) {
</a> </a>
</div> </div>
)} )}
{result.content_length != null && (
<div>
<span className="font-medium text-muted-foreground">Content: </span>
<span>{result.content_length} characters</span>
</div>
)}
{result.content_preview && (
<div>
<span className="font-medium text-muted-foreground">Preview: </span>
<span className="text-muted-foreground italic">{result.content_preview}</span>
</div>
)}
</div> </div>
</div> </div>
); );