import { Menu, Modal, Text, useMantineTheme } from '@mantine/core'; import { showNotification } from '@mantine/notifications'; import { useState } from 'react'; import { Check, Edit, Trash } from 'tabler-icons-react'; import { useConfig } from '../../tools/state'; import { AddAppShelfItemForm } from './AddAppShelfItem'; export default function AppShelfMenu(props: any) { const { service } = props; const { config, setConfig } = useConfig(); const theme = useMantineTheme(); const [opened, setOpened] = useState(false); return ( <> setOpened(false)} title="Modify a service" > Settings } // TODO: #2 Add the ability to edit the service. onClick={() => setOpened(true)} > Edit Danger zone { setConfig({ ...config, services: config.services.filter((s) => s.name !== service.name), }); showNotification({ autoClose: 5000, title: ( Service {service.name} removed successfully ), color: 'green', icon: , message: undefined, }); }} icon={} > Delete ); }