[dyad] Added keyword highlighting - wrote 3 file(s)

This commit is contained in:
[dyad]
2026-01-20 14:44:18 +01:00
parent c2d217b7d6
commit c8a23d3b51
3 changed files with 70 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { ImageAltDisplay } from "./image-alt-display";
import { TabIndicator } from "./tab-indicator";
import { getLengthIndicatorColor, type IndicatorColor } from "@/lib/analysis";
import { KeywordHighlighter } from "./keyword-highlighter";
interface MetaData {
title: string;
@@ -259,6 +260,7 @@ export function MetaForm() {
title={editableTitle}
description={editableDescription}
url={url}
keyword={metaData.keyword}
/>
</div>
{metaData.image && (
@@ -331,7 +333,14 @@ export function MetaForm() {
/>
) : (
<p className="text-muted-foreground bg-muted p-3 rounded-md min-h-[40px] break-words">
{editableTitle || "Not found"}
{editableTitle ? (
<KeywordHighlighter
text={editableTitle}
keyword={metaData.keyword}
/>
) : (
"Not found"
)}
</p>
)}
</div>
@@ -385,7 +394,14 @@ export function MetaForm() {
/>
) : (
<p className="text-muted-foreground bg-muted p-3 rounded-md min-h-[100px] break-words">
{editableDescription || "Not found"}
{editableDescription ? (
<KeywordHighlighter
text={editableDescription}
keyword={metaData.keyword}
/>
) : (
"Not found"
)}
</p>
)}
</div>