({ content }: { content: any })
| 284 | } |
| 285 | |
| 286 | function Check({ content }: { content: any }) { |
| 287 | const [completed, setCompleted] = useState( |
| 288 | content?.videoProgress?.markAsCompleted || false, |
| 289 | ); |
| 290 | |
| 291 | const handleCheck = useCallback( |
| 292 | async (e: React.MouseEvent<HTMLInputElement>) => { |
| 293 | e.stopPropagation(); |
| 294 | const newState = !completed; |
| 295 | setCompleted(newState); |
| 296 | await handleMarkAsCompleted(newState, content.id); |
| 297 | }, |
| 298 | [completed, content.id], |
| 299 | ); |
| 300 | |
| 301 | return ( |
| 302 | <input |
| 303 | checked={completed} |
| 304 | onChange={() => {}} // Controlled component |
| 305 | onClick={handleCheck} |
| 306 | type="checkbox" |
| 307 | className="focus:ring-none h-4 w-4 rounded-md border-primary/10" |
| 308 | /> |
| 309 | ); |
| 310 | } |
nothing calls this directly
no test coverage detected