import { Input, TextInput, Text, ActionIcon, useMantineTheme } from '@mantine/core'; import { showNotification } from '@mantine/notifications'; import { useState, useEffect } from 'react'; import { Search, ArrowRight, ArrowLeft } from 'tabler-icons-react'; import { Config, loadConfig } from '../../tools/config'; export default function SearchBar(props: any) { const theme = useMantineTheme(); const [config, setConfig] = useState({ searchBar: true, }); useEffect(() => { const config = loadConfig('settings'); if (config) { showNotification({ autoClose: 1000, title: Config loaded, message: undefined, }); setConfig(config); } }, []); return ( } radius="xl" size="md" placeholder="Search the web" onChange={(e) => { showNotification({ autoClose: 1000, title: Searching for {e.target.value}, message: undefined, }); }} rightSectionWidth={42} {...props} /> ); }