caelum0x 174222bcaa feat: Builder-Track named-user tools, bio + evidence-intelligence platform, Apache-2.0
Builds PaperTrail from the base skeleton into a full evidence-verification platform
for the "Built with Claude: Life Sciences" hackathon (Builder Track).

New named-user features (Build Beyond the Bench):
- Lab Notebook Companion — rough bench notes -> structured, searchable, grounded
  experiment records (lib/labNotebook, /console/lab-notebook, migration 0059)
- Clinical Trial Matcher — de-identified patient notes -> ranked eligible
  ClinicalTrials.gov trials with per-criterion inclusion/exclusion reasoning
  (lib/trialMatcher, /console/trial-matcher, migrations 0060)

Platform:
- Deterministic verification moat (biostats recompute, exact-span grounding)
- 11 biomedical evidence engines (FAERS, GWAS, Open Targets, ChEMBL, ClinVar,
  PharmGKB, PubTator, DDI, repurposing, biomarker, unified verifier)
- Evidence Intelligence (KG, dossier, provenance/export, RWE) + enterprise
  governance (RBAC, /api/v1 gateway, metering, audit chain, retention)
- 17 OSS projects assimilated into native TypeScript on our stack (backend/engines
  retained + credited in NOTICE)
- Multi-format upload (PDF/DOCX/XLSX/CSV/MD/TXT), logo, marketing site
- Next.js 16 upgrade, benchmark harness (honest smoke-test caveat)

Licensing: Apache-2.0 (LICENSE + NOTICE).
2026-07-10 16:23:13 +03:00

95 lines
3.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { useEffect } from 'react';
import { TouchEventHandler } from 'react';
interface ImageModalProps {
imageSrc: any;
isOpen: boolean;
onClose: () => void;
onNext?: () => void;
onPrev?: () => void;
}
export default function ImageModal({ imageSrc, isOpen, onClose, onNext, onPrev }: ImageModalProps) {
useEffect(() => {
if (!isOpen) return;
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'ArrowLeft') {
onPrev?.();
} else if (e.key === 'ArrowRight') {
onNext?.();
} else if (e.key === 'Escape') {
onClose();
}
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [isOpen, onClose, onNext, onPrev]);
if (!isOpen) return null;
// Swipe detection for mobile
let touchStartX = 0;
let touchEndX = 0;
const handleTouchStart = (e: TouchEvent) => {
touchStartX = e.changedTouches[0].screenX;
};
const handleTouchEnd = (e: TouchEvent) => {
touchEndX = e.changedTouches[0].screenX;
handleSwipeGesture();
};
const handleSwipeGesture = () => {
if (touchEndX < touchStartX - 50) {
onNext?.();
} else if (touchEndX > touchStartX + 50) {
onPrev?.();
}
};
const handleClose = (e: React.MouseEvent<HTMLDivElement>) => {
if (e.target === e.currentTarget) {
onClose();
}
};
return (
<div
className="fixed inset-0 bg-black bg-opacity-75 z-50 flex items-center justify-center p-4 overflow-auto"
onClick={handleClose}
onTouchStart={handleTouchStart as unknown as TouchEventHandler<HTMLDivElement>}
onTouchEnd={handleTouchEnd as unknown as TouchEventHandler<HTMLDivElement>}
>
<div className="relative max-w-[90vw] max-h-[90vh] flex items-center justify-center">
<button
onClick={onPrev}
className="absolute left-4 z-10 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-75"
>
←
</button>
<img
src={imageSrc}
alt="Modal view"
className="max-h-[90vh] max-w-[90vw] object-contain"
/>
<button
onClick={onNext}
className="absolute right-4 z-10 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-75"
>
→
</button>
<button
onClick={onClose}
className="absolute top-4 right-4 z-10 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-75"
>
×
</button>
</div>
</div>
);
}