Skip to content

An AI-powered search engine with a generative UI

feat: Update CopilotDisplay to handle additional_query with non-empty value

Yoshiki Miuradfd00c267883
diff --git a/components/copilot-display.tsx b/components/copilot-display.tsx
index 34d22158..3ab2f57e 100644
--- a/components/copilot-display.tsx
+++ b/components/copilot-display.tsx
@@ -14,7 +14,10 @@ export function CopilotDisplay({ content }: CopilotDisplayProps) {
const json = JSON.parse(content)
const formDataEntries = Object.entries(json)
const query = formDataEntries
- .filter(([key, value]) => value === 'on' || key === 'additional_query')
+ .filter(
+ ([key, value]) =>
+ value === 'on' || (key === 'additional_query' && value !== '')
+ )
.map(([key, value]) => (key === 'additional_query' ? value : key))
.join(', ')
diff --git a/components/copilot.tsx b/components/copilot.tsx
index 8d6fc6da..b8a39a32 100644
--- a/components/copilot.tsx
+++ b/components/copilot.tsx
@@ -115,7 +115,6 @@ export const Copilot: React.FC<CopilotProps> = ({ inquiry }: CopilotProps) => {
return (
<Card className="p-3 md:p-4 w-full flex justify-between items-center">
<div className="flex items-center space-x-2 flex-1 min-w-0">
- <IconLogo className="w-4 h-4 flex-shrink-0" />
<h5 className="text-muted-foreground text-xs truncate">
{updatedQuery()}
</h5>