'use client'; import { useState } from 'react'; import _ from 'lodash'; import { IconButton, CloseButton, Drawer, Portal, Tabs, } from '@chakra-ui/react'; import dynamic from 'next/dynamic'; import { FiSettings } from 'react-icons/fi'; import { useTestContext } from '../context'; const JsonCodeBlock = dynamic(() => import('./JsonCodeBlock'), { ssr: false }); type TabType = 'test' | 'bot'; interface TestCardConfigDrawerPanelProps { open: boolean; onOpenChange: (open: boolean) => void; } export const TestCardConfigDrawerPanel = ({ open, onOpenChange, }: TestCardConfigDrawerPanelProps) => { const [tab, setTab] = useState('test'); const { testResult } = useTestContext(); const getTestConf = () => JSON.stringify(testResult.test, null, 2); const getBotConf = () => JSON.stringify( _.omit( { ...testResult.test, disabled: false }, 'name', 'testSuiteId', 'options', ), null, 2, ); return ( setTab(e.value as TabType)} variant={'line'} > onOpenChange(e.open)} size={'lg'} > Configuration Test Bot ); }; export const TestCardConfigDrawer = () => { const [open, setOpen] = useState(false); return ( <> setOpen(true)} > ); };