evOo-local/apps/mobile/lib/ai-consent.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

35 lines
1.0 KiB
TypeScript

import type { AiRecipient } from "@rakazo/contracts";
import { AI_DATA_DISCLOSURES, AI_PRIVACY_URL } from "@rakazo/contracts";
import { Alert, Linking } from "react-native";
export function promptAiConsent(
recipient: AiRecipient,
privacyUrl = AI_PRIVACY_URL,
): Promise<boolean> {
return new Promise((resolve) => {
const show = () =>
Alert.alert(
`Share data with ${recipient.name}?`,
[
recipient.detail,
AI_DATA_DISCLOSURES[recipient.use],
"You can withdraw permission for new mobile actions in Account → AI data sharing.",
]
.filter(Boolean)
.join("\n\n"),
[
{ text: "Not now", style: "cancel", onPress: () => resolve(false) },
{
text: "Privacy policy",
onPress: () => {
void Linking.openURL(privacyUrl).finally(show);
},
},
{ text: "Allow", onPress: () => resolve(true) },
],
{ cancelable: true, onDismiss: () => resolve(false) },
);
show();
});
}