diff --git a/frontend/src/components/email/ContractEmailsSection.tsx b/frontend/src/components/email/ContractEmailsSection.tsx index d0af7255..0a5b2cc8 100644 --- a/frontend/src/components/email/ContractEmailsSection.tsx +++ b/frontend/src/components/email/ContractEmailsSection.tsx @@ -298,6 +298,16 @@ export default function ContractEmailsSection({ Postfach öffnen + + + Stressfrei wechseln Adressen + } actions={ diff --git a/frontend/src/components/ui/Select.tsx b/frontend/src/components/ui/Select.tsx index 8acc5d6f..7b421a95 100644 --- a/frontend/src/components/ui/Select.tsx +++ b/frontend/src/components/ui/Select.tsx @@ -1,7 +1,7 @@ -import { SelectHTMLAttributes, forwardRef } from 'react'; +import { SelectHTMLAttributes, forwardRef, ReactNode } from 'react'; interface SelectProps extends SelectHTMLAttributes { - label?: string; + label?: ReactNode; error?: string; options: { value: string | number; label: string }[]; placeholder?: string; diff --git a/frontend/src/pages/contracts/ContractForm.tsx b/frontend/src/pages/contracts/ContractForm.tsx index 7c6da545..95eb6a7c 100644 --- a/frontend/src/pages/contracts/ContractForm.tsx +++ b/frontend/src/pages/contracts/ContractForm.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; -import { useNavigate, useParams, useSearchParams, useLocation } from 'react-router-dom'; +import { useNavigate, useParams, useSearchParams, useLocation, Link } from 'react-router-dom'; import { popHistory } from '../../utils/navigation'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useForm } from 'react-hook-form'; @@ -12,7 +12,29 @@ import Select from '../../components/ui/Select'; import type { ContractType } from '../../types'; import { formatDate } from '../../utils/dateFormat'; import { useProviderSettings } from '../../hooks/useProviderSettings'; -import { Plus, Trash2, Eye, EyeOff, Info, X, ArrowLeft } from 'lucide-react'; +import { Plus, Trash2, Eye, EyeOff, Info, X, ArrowLeft, ExternalLink } from 'lucide-react'; + +// Kleine Helper-Komponente: Label + Mini-Link im neuen Tab. Wird neben +// Select-Feldern eingesetzt, deren Stammdaten an anderer Stelle gepflegt +// werden (Kundenakte, Settings) – damit der User direkt von dort in die +// passende Verwaltungsseite springen kann. +function LabelWithLink({ children, to, title }: { children: React.ReactNode; to: string; title: string }) { + return ( + + {children} + e.stopPropagation()} + > + + + + ); +} import { calculateConsumption, calculateMultiMeterConsumption } from '../../utils/energyCalculations'; // Contract types are now loaded dynamically from the database @@ -752,7 +774,11 @@ export default function ContractForm() { + Lieferadresse + + } {...register('addressId')} options={addresses .filter((a) => a.type === 'DELIVERY_RESIDENCE') @@ -810,7 +840,11 @@ export default function ContractForm() { /> + Bankkarte + + } {...register('bankCardId')} options={bankCards.map((c) => ({ value: c.id, @@ -832,7 +870,11 @@ export default function ContractForm() { /> + Anbieter + + } {...register('providerId')} options={providers.map((p) => ({ value: p.id, label: p.name }))} />