Download frontend/src/components/ProtocolList.tsx from Smart-Slate/Systematic-tool-review: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/spaces/Smart-Slate/Systematic-tool-review/resolve/main/frontend/src/components/ProtocolList.tsx
- Command line
-
hf download hf://spaces/Smart-Slate/Systematic-tool-review/frontend/src/components/ProtocolList.tsx
-
curl -L -o ProtocolList.tsx https://huggingface.co/spaces/Smart-Slate/Systematic-tool-review/resolve/main/frontend/src/components/ProtocolList.tsx
1.49 kB
| import type { Protocol } from "../types"; | |
| interface ProtocolListProps { | |
| protocols: Protocol[]; | |
| onSelect: (id: string) => void; | |
| onNew: () => void; | |
| } | |
| export function ProtocolList({ protocols, onSelect, onNew }: ProtocolListProps) { | |
| return ( | |
| <div className="protocol-list-page"> | |
| <div className="list-header"> | |
| <h1>Review protocols</h1> | |
| <button className="primary-btn" onClick={onNew}> | |
| + New protocol | |
| </button> | |
| </div> | |
| {protocols.length === 0 ? ( | |
| <p className="empty-state"> | |
| No protocols yet. Start a new one to declare your research question | |
| before searching. | |
| </p> | |
| ) : ( | |
| <div className="protocol-cards"> | |
| {protocols.map((p) => ( | |
| <button | |
| key={p.id} | |
| className="protocol-card" | |
| onClick={() => onSelect(p.id)} | |
| > | |
| <div className="protocol-card-header"> | |
| <span className="protocol-title">{p.title}</span> | |
| <span className={`status-badge status-${p.status}`}> | |
| {p.status} | |
| </span> | |
| </div> | |
| <p className="protocol-summary"> | |
| {p.intervention} → {p.outcome} | |
| </p> | |
| <p className="protocol-sources"> | |
| {p.sources.length} source{p.sources.length !== 1 ? "s" : ""} | |
| </p> | |
| </button> | |
| ))} | |
| </div> | |
| )} | |
| </div> | |
| ); | |
| } | |