Ignore:
Timestamp:
12/29/25 00:37:49 (6 months ago)
Author:
Mihail <mihail2.naumov@…>
Branches:
main
Children:
5af32f0
Parents:
ae5d054
Message:

Added Forge Page, added suggest component, fixed styling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/ComponentDetailsDialog.tsx

    rae5d054 r8a7f936  
    3333    const renderValue = (key: string, val: any) => {
    3434        if (Array.isArray(val)) {
    35             if (val.length > 0 && typeof val[0] === 'object') {
    36                 return val.map((v: any) => v.formFactor || v.socket || JSON.stringify(v)).join(', ');
     35            if (val.length === 0) return 'None';
     36
     37            if (typeof val[0] === 'string') {
     38                return val.join(', ');
    3739            }
     40
     41            if (typeof val[0] === 'object') {
     42                const parts = val
     43                    .map((v: any) =>
     44                        v.socket ||
     45                        v.formFactor ||
     46                        v.name ||
     47                        v.type ||
     48                        Object.values(v)[0]
     49                    )
     50                    .filter(Boolean);
     51                return parts.length > 0 ? parts.join(', ') : 'None';
     52            }
     53
    3854            return val.join(', ');
    3955        }
     
    4258        const lowerKey = key.toLowerCase();
    4359
    44         // Dodava merni edinici vo zavisnost koja komponenta e
    4560        if (lowerKey.includes('capacity') || lowerKey.includes('vram') || lowerKey === 'memory') {
    4661            return `${strVal} GB`;
     
    5873            return `${strVal} GHz`;
    5974        }
     75
    6076        if (lowerKey.includes('speed')) {
    6177            return `${strVal} MHz`;
Note: See TracChangeset for help on using the changeset viewer.