feat(admin): live flight status, booking mail import and paddle water data as rows of the addon cards

The addons page listed the trip, global and integration addons and then three
loose cards under them: live flight status, the booking mail import and the
paddle water data. They now sit where they belong, as rows of the cards:

- Live flight status is a row of the trip card, with its switch, locked when
  FLIGHT_LIVE_ENABLED holds it.
- The booking mail import is a row of the integration card with its switch;
  while it is on, "Set up mail import" opens the transport, address, AI
  allowance, test and status in a dialog, the way AI is set up.
- The paddle water data are a row under the Tours addon that opens the
  regions in a dialog, counting the open requests, else the regions.

The phone follows with the same rows and bottom sheets. The setup row and the
setup dialog are shared components (AddonSetupRow, AddonSetupDialog on the
desktop, MAdminOptionRow and MAdminSetupRow on the phone), the card counts
stay the addons' own, and the settings tab loses its features part.
This commit is contained in:
Maurice
2026-11-21 00:23:13 +01:00
parent 6ebd5cf0c7
commit 711015d5fd
52 changed files with 596 additions and 263 deletions
@@ -0,0 +1,38 @@
import { ChevronRight, Settings2 } from 'lucide-react';
import React, { type ReactNode } from 'react';
import { fs } from '../shared/DialogShell';
/**
* The last row of an addon's shelf that opens its settings dialog: a gear, what
* the dialog sets up, and a chevron. It keeps a card of addons as short as its
* switches and puts the long forms behind one tap (AI, booking mails, paddle
* water data). A badge says what waits inside, such as requests to look at.
*/
export default function AddonSetupRow({
label,
onOpen,
badge,
}: {
label: string;
onOpen: () => void;
badge?: ReactNode;
}): React.ReactElement {
return (
<li>
<button
type="button"
onClick={onOpen}
className="flex min-h-[44px] w-full items-center gap-2.5 border-0 bg-transparent py-1.5 pe-4 ps-[60px] text-start transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover focus-visible:outline-none"
>
<span className="grid h-6 w-6 flex-none place-items-center text-content-muted">
<Settings2 size={14} />
</span>
<span className="min-w-0 flex-1 truncate font-medium text-content" style={fs(12.5, 'body')}>
{label}
</span>
{badge}
<ChevronRight size={15} strokeWidth={2.2} className="flex-none text-content-faint rtl:rotate-180" />
</button>
</li>
);
}