import { ActionIcon, Button, Group, Highlight, Popover, Stack, Switch, Text, } from '@mantine/core'; import { useCommonHooks } from 'hooks'; import { useState } from 'react'; import { FiHelpCircle, FiLoader, FiPlus, FiX } from 'react-icons/fi'; import { actionIconClasses, buttonClasses, popoverClasses, switchClasses, textClasses, textInputClasses, } from 'styles'; import { DebouncedInput } from './DebouncedInput'; export function SettingsHeader({ setDragging, openModal, title, tooltip, searchValue, setSearchValue, searchPlaceholder, isLoading, setIsLoading, }: { setDragging: undefined | ((dragging: boolean) => void); openModal: undefined | (() => void); title: string; tooltip: { title: string; highlightList: string[]; description: string; }; searchValue: string | number | undefined; setSearchValue: (searchValue: string | number) => void; searchPlaceholder: string | undefined; isLoading: boolean; setIsLoading: (isLoading: boolean) => void; }) { const { isMobile, theme } = useCommonHooks(); const [disabled, setDisabled] = useState(false); return ( {title} {tooltip.title} {tooltip.description} {openModal !== undefined && ( )} {searchValue !== undefined && ( setIsLoading(true)} onChange={(value: any) => { setSearchValue(value); }} style={{ zIndex: 100, }} styles={ theme.textShadowsEnabled ? { label: { boxShadow: '2px 2px var(--mantine-color-border-0)' }, } : undefined } rightSection={ isLoading ? ( ) : ( searchValue && ( setSearchValue('')} > ) ) } /> )} {setDragging && ( { setDragging(e.target.checked); setDisabled(e.target.checked); }} /> )} ); }