import { Anchor, Button, Card, Collapse, Group, Stack, Tabs, Text, TextInput } from '@mantine/core'; import { UseFormReturnType } from '@mantine/form'; import { useDisclosure } from '@mantine/hooks'; import { IconClick, IconCursorText, IconLink } from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; import { AppType } from '~/types/app'; import { EditAppModalTab } from '../type'; interface GeneralTabProps { form: UseFormReturnType AppType>; openTab: (tab: EditAppModalTab) => void; } export const GeneralTab = ({ form, openTab }: GeneralTabProps) => { const { t } = useTranslation('layout/modals/add-app'); const [opened, { toggle }] = useDisclosure(false); const commonMistakes = [ t('general.internalAddress.troubleshoot.lines.nothingAfterPort'), t('general.internalAddress.troubleshoot.lines.protocolCheck'), t('general.internalAddress.troubleshoot.lines.preferIP'), t('general.internalAddress.troubleshoot.lines.enablePings'), t('general.internalAddress.troubleshoot.lines.wget'), t('general.internalAddress.troubleshoot.lines.iframe'), ]; return ( } label={t('general.appname.label')} description={t('general.appname.description')} placeholder="My example app" variant="default" withAsterisk {...form.getInputProps('name')} /> } label={t('general.internalAddress.label')} description={t('general.internalAddress.description')} placeholder="https://google.com" variant="default" withAsterisk {...form.getInputProps('url')} onChange={(e) => { form.setFieldValue('url', e.target.value); }} /> } label={t('general.externalAddress.label')} description={t('general.externalAddress.description')} placeholder="https://homarr.mywebsite.com/" variant="default" {...form.getInputProps('behaviour.externalUrl')} /> {t('general.internalAddress.troubleshoot.header')} {commonMistakes.map((value: string, key: number) => { return ( {value} ); })} {t('general.internalAddress.troubleshoot.footer').split('{{discord}}')[0]} Discord {t('general.internalAddress.troubleshoot.footer').split('{{discord}}')[1]} {!form.values.behaviour.externalUrl.startsWith('https://') && !form.values.behaviour.externalUrl.startsWith('http://') && ( {t('behaviour.customProtocolWarning')} )} ); };