evOo-local/apps/mobile/lib/search-destination.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

41 lines
1.0 KiB
TypeScript

import type { SearchHit } from "@rakazo/contracts";
export function mobileSearchDestination(hit: SearchHit):
| {
pathname: "/routine";
params: { botId: string; botName: string; routineId: string };
}
| {
pathname: "/group-thread";
params: { groupId: string; name: string; messageId?: string };
}
| {
pathname: "/thread";
params: { botId: string; name: string; messageId?: string };
} {
if (hit.routineId) {
return {
pathname: "/routine",
params: { botId: hit.botId!, botName: hit.botName!, routineId: hit.routineId },
};
}
if (hit.groupId) {
return {
pathname: "/group-thread",
params: {
groupId: hit.groupId,
name: hit.groupName ?? hit.title,
...(hit.messageId ? { messageId: hit.messageId } : {}),
},
};
}
return {
pathname: "/thread",
params: {
botId: hit.botId!,
name: hit.botName ?? hit.title,
...(hit.messageId ? { messageId: hit.messageId } : {}),
},
};
}