import { Card } from '../card'; import type { CardProps } from '../card'; import type { DropdownMenuItem, DropDownMenuProps } from '../../dropdown-menu'; import { RenderTextGroupCell } from '../card-grid'; import { Select } from '../../@forms/select'; import { Button } from '../../button'; import { MouseEventHandler, useState, useCallback } from 'react'; import makeStyles from '@mui/styles/makeStyles'; import type { Theme } from '../../@styles/theme-provider'; export interface AgentMinVersionProps { icon: string; title: string; subtitle: string; valueList: DropdownMenuItem[]; /** * Pass text to mark as read button. * @default 'Update' */ btnTxt?: string; /** * Pass text to mark as read button. * @default 'Select Version' */ dropDownPlaceholder?: string; btnOnClick?: MouseEventHandler; } const createClasses = makeStyles(() => ({ labelRoot: { width: '200px', height: '40px' } })); export function AgentMinVersion(props: AgentMinVersionProps & CardProps) { const { icon, subtitle, title, valueList, btnTxt = 'Update', dropDownPlaceholder = 'Select Version', btnOnClick, ...rest } = props; const classes = createClasses(); const [selectValue, setSelectValue] = useState(''); const handleSelectChange: NonNullable = name => () => { const selected = selectValue === name ? '' : name.toString(); setSelectValue(selected); }; return ( ), flex: 'auto', minWidth: 180 }, { field: 'iconAndSearch', children: (