mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 09:46:19 +01:00
✨ Add generic menu for tiles
This commit is contained in:
39
src/components/Dashboard/Tiles/Service/ServiceMenu.tsx
Normal file
39
src/components/Dashboard/Tiles/Service/ServiceMenu.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { openContextModalGeneric } from '../../../../tools/mantineModalManagerExtensions';
|
||||
import { ServiceType } from '../../../../types/service';
|
||||
import { GenericTileMenu } from '../GenericTileMenu';
|
||||
|
||||
interface TileMenuProps {
|
||||
service: ServiceType;
|
||||
}
|
||||
|
||||
export const ServiceMenu = ({ service }: TileMenuProps) => {
|
||||
const handleClickEdit = () => {
|
||||
openContextModalGeneric<{ service: ServiceType }>({
|
||||
modal: 'editService',
|
||||
size: 'xl',
|
||||
innerProps: {
|
||||
service,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleClickChangePosition = () => {
|
||||
openContextModalGeneric({
|
||||
modal: 'changeTilePosition',
|
||||
innerProps: {
|
||||
tile: service,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleClickDelete = () => {};
|
||||
|
||||
return (
|
||||
<GenericTileMenu
|
||||
handleClickEdit={handleClickEdit}
|
||||
handleClickChangePosition={handleClickChangePosition}
|
||||
handleClickDelete={handleClickDelete}
|
||||
displayEdit
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user