From b8fffb5e8b586aea97caa724d8babd44ef5b7ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 2 Aug 2023 12:06:19 +0200 Subject: [PATCH] frontend: upating general component (removing boolean and numbers) --- frontend/src/components/component.tsx | 28 +++------------------------ 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/frontend/src/components/component.tsx b/frontend/src/components/component.tsx index 3067db0..4f623f1 100644 --- a/frontend/src/components/component.tsx +++ b/frontend/src/components/component.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react'; interface ComponentProps { name: string; + parent_path: string; value: any; readOnly: boolean; type: string; @@ -19,27 +20,13 @@ export const ComponentLabel = ({ }; export const Component = React.memo( - ({ name, value, readOnly, type, docString }: ComponentProps) => { + ({ name, parent_path, value, readOnly, type, docString }: ComponentProps) => { const renderCount = useRef(0); useEffect(() => { renderCount.current++; }); switch (type) { - case 'int': - case 'float': - return ( - <> -

Render count: {renderCount.current}

- - - ); case 'str': return ( <> @@ -50,19 +37,10 @@ export const Component = React.memo( value={value} readOnly={readOnly} title={docString} + id={parent_path} /> ); - case 'bool': - return ( - - ); case 'method': return ( <>