File size: 1,031 Bytes
1c76dfa
347dddd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c76dfa
 
 
 
 
 
 
347dddd
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// frontend/src/components/ModelSelect.jsx
import styles from "../styles/Card.module.css";

export default function ModelSelect({ models, selected, onSelect }) {
    return (
        <div>
            <h2>Select Model</h2>
            <div className={styles.grid}>
                {models.map((m) => (
                    <div
                        key={m.id}
                        className={`${styles.card} ${selected === m.id ? styles.active : ""}`}
                        onClick={() => onSelect(m.id)}
                    >
                        <h3>{m.title}</h3>
                        <small>{m.author}</small>
                        <a
                            href={`http://localhost:3001/api/models/download/${m.id}`}
                            download
                            onClick={(e) => e.stopPropagation()}
                        >
                            Download Model
                        </a>
                    </div>
                ))}
            </div>
        </div>
    );
}