managarten/memoro/apps/mobile/components/atoms/Alert.tsx
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

37 lines
1 KiB
TypeScript

import { Alert as RNAlert } from 'react-native';
import { AlertButtonProps, IAlertService } from './alert.types';
/**
* Alert component that wraps React Native's Alert API
* This is the base implementation used by native platforms
*
* Provides a cross-platform alert dialog interface
*
* Example:
* ```tsx
* Alert.alert(
* 'Title',
* 'Message',
* [
* { text: 'Cancel', style: 'cancel' },
* { text: 'OK', onPress: () => console.log('OK Pressed') }
* ]
* );
* ```
*/
class AlertService implements IAlertService {
/**
* Displays an alert dialog with the specified title, message, and buttons
*
* @param title The title of the alert
* @param message The message to display in the alert
* @param buttons Array of buttons to display in the alert
*/
alert(title: string, message?: string, buttons?: AlertButtonProps[]): void {
RNAlert.alert(title, message, buttons);
}
}
// Create and export singleton instance
const alertService = new AlertService();
export default alertService;