MCPcopy Create free account
hub / github.com/code100x/cms / Check

Function Check

src/components/Sidebar.tsx:286–310  ·  view source on GitHub ↗
({ content }: { content: any })

Source from the content-addressed store, hash-verified

284}
285
286function 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}

Callers

nothing calls this directly

Calls 1

handleMarkAsCompletedFunction · 0.90

Tested by

no test coverage detected