Spaces:
Paused
Paused
Download frontend/packages/shared/src/components/ApprovalCard.tsx from TeamError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/spaces/TeamError404/nexus/resolve/main/frontend/packages/shared/src/components/ApprovalCard.tsx
- Command line
-
hf download hf://spaces/TeamError404/nexus/frontend/packages/shared/src/components/ApprovalCard.tsx
-
curl -L -o ApprovalCard.tsx https://huggingface.co/spaces/TeamError404/nexus/resolve/main/frontend/packages/shared/src/components/ApprovalCard.tsx
1.66 kB
| import React from 'react'; | |
| import { Button } from './Button'; | |
| import styles from './ApprovalCard.module.css'; | |
| interface PendingAction { | |
| tool: string; | |
| action: string; | |
| params: Record<string, any>; | |
| description: string; | |
| } | |
| interface ApprovalCardProps { | |
| action: PendingAction; | |
| onApprove: (action: PendingAction) => void; | |
| onReject: (action: PendingAction) => void; | |
| loading?: boolean; | |
| } | |
| export const ApprovalCard: React.FC<ApprovalCardProps> = ({ action, onApprove, onReject, loading }) => { | |
| return ( | |
| <div className={styles.card}> | |
| <div className={styles.header}> | |
| <div className={styles.icon}>⚠️</div> | |
| <div className={styles.info}> | |
| <h3 className={styles.title}>Approval Required</h3> | |
| <p className={styles.tool}>{action.tool}: {action.action}</p> | |
| </div> | |
| </div> | |
| <div className={styles.content}> | |
| <p className={styles.description}>{action.description}</p> | |
| <div className={styles.params}> | |
| {Object.entries(action.params).map(([key, val]) => ( | |
| <div key={key} className={styles.paramRow}> | |
| <span className={styles.paramKey}>{key}:</span> | |
| <span className={styles.paramVal}>{JSON.stringify(val)}</span> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| <div className={styles.actions}> | |
| <Button onClick={() => onReject(action)} variant="outline" className={styles.rejectBtn}> | |
| Reject Action | |
| </Button> | |
| <Button onClick={() => onApprove(action)} loading={loading} className={styles.approveBtn}> | |
| Approve & Execute | |
| </Button> | |
| </div> | |
| </div> | |
| ); | |
| }; | |