Added General Cardiology and Emergency section, implemented more calculators (TIMI score, MAP)

This commit is contained in:
2026-03-31 20:04:51 +05:30
parent 537dd03362
commit 7a0ba9e459
10 changed files with 225 additions and 13 deletions

View File

@@ -12,13 +12,22 @@ export default function RenderCalculator({section, id} : {section:string, id:str
const calculator = CalculatorRegistry[section].calculators.find(e => e.id === id);
const [form, setForm] = useState<Record<string, string | number>>({});
const [value, setValue] = useState<string | number>("");
function handleDataChange(key:string, value:string){
setForm(prev => {
return {
...prev,
[key]:value
}
});
function handleDataChange(key:string, value:string, type: "number" | "string" | boolean){
if(type === "number"){
setForm(prev => {
return {
...prev,
[key]:Number(value)
}
});
}else{
setForm(prev => {
return {
...prev,
[key]:value
}
});
}
}
const [showResult, setResultStatus] = useState<boolean>(false);
const [result, setResult] = useState<Interpretation>({