Zeige die echten Produktwerte aus der Trefferliste und vermeide doppelte RAM/Speicher-Schluessel.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
33336bcb6e
commit
e6d53e0eeb
6 files changed
+142
-34
No files matched your search
+7
-2
@@ -141,7 +141,12 @@ export type Candidate = {
|
||||
source_url?: string | null;
|
||||
current_best_price?: string | null;
|
||||
currency?: string | null;
|
||||
current_dynamic_attributes?: { raw_name: string; normalized_value: unknown; unit?: string | null }[];
|
||||
current_dynamic_attributes?: {
|
||||
raw_name: string;
|
||||
raw_value?: unknown;
|
||||
normalized_value: unknown;
|
||||
unit?: string | null;
|
||||
}[];
|
||||
product_score?: number | null;
|
||||
product_eligibility?: string | null;
|
||||
ranking_status: string;
|
||||
@@ -160,7 +165,7 @@ export type Observation = {
|
||||
currency?: string | null;
|
||||
availability?: string | null;
|
||||
seller_count?: number | null;
|
||||
dynamic_attributes?: { raw_name: string; normalized_value: unknown }[];
|
||||
dynamic_attributes?: { raw_name: string; raw_value?: unknown; normalized_value: unknown }[];
|
||||
};
|
||||
export type Source = { id: string; name: string };
|
||||
export type SourceCategory = {
|
||||
|
||||
@@ -32,11 +32,15 @@ export function CandidateDetailPage() {
|
||||
</div>
|
||||
<div className="card">
|
||||
<h2>Attribute</h2>
|
||||
{(Array.isArray(item.current_dynamic_attributes) ? item.current_dynamic_attributes : []).map((attr) => (
|
||||
<p key={attr.raw_name}>
|
||||
{attr.raw_name}: {String(attr.normalized_value ?? "")} {attr.unit || ""}
|
||||
</p>
|
||||
))}
|
||||
{(Array.isArray(item.current_dynamic_attributes) ? item.current_dynamic_attributes : []).map((attr) => {
|
||||
const value = attr.raw_value ?? attr.normalized_value;
|
||||
if (value == null || value === "") return null;
|
||||
return (
|
||||
<p key={attr.raw_name}>
|
||||
{attr.raw_name}: {String(value)} {attr.unit || ""}
|
||||
</p>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="card">
|
||||
<h2>Historie</h2>
|
||||
|
||||
Reference in new issue
Block a user