import { Group, Space, Stack, Text, UnstyledButton } from '@mantine/core'; import { IconBox, IconPlug, IconTextResize } from '@tabler/icons'; import { useTranslation } from 'next-i18next'; import { ReactNode } from 'react'; import { v4 as uuidv4 } from 'uuid'; import { openContextModalGeneric } from '../../../../../../tools/mantineModalManagerExtensions'; import { ServiceType } from '../../../../../../types/service'; import { useStyles } from '../Shared/styles'; interface AvailableElementTypesProps { onOpenIntegrations: () => void; onOpenStaticElements: () => void; } export const AvailableElementTypes = ({ onOpenIntegrations, onOpenStaticElements, }: AvailableElementTypesProps) => { const { t } = useTranslation('layout/element-selector/selector'); return ( <> {t('modal.text')} } onClick={() => { openContextModalGeneric<{ service: ServiceType }>({ modal: 'editService', innerProps: { service: { id: uuidv4(), name: 'Your service', url: 'https://homarr.dev', appearance: { iconUrl: '/imgs/logo/logo.png', }, network: { enabledStatusChecker: false, okStatus: [], }, integration: { type: 'deluge', properties: {}, }, }, }, size: 'xl', }); }} /> } onClick={onOpenIntegrations} /> } onClick={onOpenStaticElements} /> ); }; interface ElementItemProps { icon: ReactNode; name: string; onClick: () => void; } const ElementItem = ({ name, icon, onClick }: ElementItemProps) => { const { classes, cx } = useStyles(); return ( {icon} {name} ); };