From a74c1bf06afdcf8044c9af2e3279ba76701d4065 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 16 Apr 2024 21:41:40 +0200 Subject: [PATCH] add option to disable accordions --- .../src/pages/part/pricing/PricingPanel.tsx | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/frontend/src/pages/part/pricing/PricingPanel.tsx b/src/frontend/src/pages/part/pricing/PricingPanel.tsx index 6199393f8d..5e980fd82c 100644 --- a/src/frontend/src/pages/part/pricing/PricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/PricingPanel.tsx @@ -1,28 +1,58 @@ import { t } from '@lingui/macro'; -import { Accordion, Alert, Space, Stack, Text } from '@mantine/core'; -import { IconExclamationCircle } from '@tabler/icons-react'; +import { + Accordion, + AccordionControlProps, + Alert, + Box, + Space, + Stack, + Text, + Tooltip +} from '@mantine/core'; +import { IconAlertCircle, IconExclamationCircle } from '@tabler/icons-react'; import { ReactNode } from 'react'; import { StylishText } from '../../../components/items/StylishText'; +function AccordionControl(props: AccordionControlProps) { + console.log(props); + return ( + + {props.disabled && ( + } + /> + )} + + + ); +} + export default function PricingPanel({ content, label, title, - visible + visible, + disabled = undefined }: { content: ReactNode; label: string; title: string; visible: boolean; + disabled: boolean | undefined; }): ReactNode { + const is_disabled = disabled === undefined ? false : disabled; return ( visible && ( - + {title} - - {content} + + {!is_disabled && content} ) );