miku-voice / frontend /src /components /ModelSelect.jsx
virtualmiku's picture
feat: organize frontend and backend files, add audio recording and upload functionality
1c76dfa
Raw History Blame Contribute Delete
1.03 kB
// 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>
);
}