mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
b64da26651
Adds an in-app assistant that reads and plans the open trip. Users connect their own provider (Sign in with ChatGPT, or an Anthropic, OpenAI, Gemini or OpenRouter key) or use the one the admin set up, including a custom OpenAI-compatible server. It is an addon and only shows while a connection is usable. The chat runs on the existing MCP tools, pinned to the trip. Every change is held as a change card the user applies or discards, and applied changes can be undone. On the desktop it is a floating window that can be moved and resized; on the phone it is fullscreen. Search results show as place cards that can go onto a day, weather lookups as a strip, proposed places as ghost markers on the map with a before/after switch, and an answer can be shared into the trip chat. Booking files can be dropped in and are read into change cards.
26 lines
992 B
TypeScript
26 lines
992 B
TypeScript
/**
|
|
* A keyboard shortcut as the keys to press, one quiet chip per key: ["⌘", "K"]
|
|
* reads as two keys, not as the text "⌘K". The chips take the colour of the
|
|
* text around them, so the same shortcut sits in a tooltip, a menu row or a
|
|
* button without a palette of its own.
|
|
*/
|
|
export default function Kbd({ keys, className = '' }: { keys: readonly string[]; className?: string }) {
|
|
return (
|
|
<kbd className={`inline-flex items-center gap-0.5 font-[inherit] ${className}`}>
|
|
{keys.map((key, i) => (
|
|
<span
|
|
key={`${key}-${i}`}
|
|
className="inline-flex min-w-[1.5em] items-center justify-center rounded border border-edge-secondary px-1 text-caption leading-[1.5] opacity-80"
|
|
>
|
|
{key}
|
|
</span>
|
|
))}
|
|
</kbd>
|
|
);
|
|
}
|
|
|
|
/** Whether shortcuts here read with ⌘ rather than Ctrl. */
|
|
export function isApplePlatform(): boolean {
|
|
return typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/.test(navigator.userAgent);
|
|
}
|