managarten/apps-archived/memoro/apps/mobile/components/atoms/PhotoUploadButton.tsx
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

57 lines
1.3 KiB
TypeScript

import React from 'react';
import { ImagePickerAsset } from 'expo-image-picker';
import Button from './Button';
import { useTranslation } from 'react-i18next';
import { photoStorageService } from '~/features/storage/photoStorage.service';
interface PhotoUploadButtonProps {
onPhotosSelected: (photos: ImagePickerAsset[]) => void;
loading?: boolean;
disabled?: boolean;
variant?: 'primary' | 'secondary' | 'outline';
title?: string;
iconName?: string;
style?: any;
allowsMultipleSelection?: boolean;
}
export default function PhotoUploadButton({
onPhotosSelected,
loading = false,
disabled = false,
variant = 'secondary',
title,
iconName = 'image-outline',
style,
allowsMultipleSelection = true,
}: PhotoUploadButtonProps) {
const { t } = useTranslation();
const handlePress = async () => {
try {
const photos = await photoStorageService.selectPhotos({
allowsMultipleSelection,
quality: 0.8,
});
if (photos.length > 0) {
onPhotosSelected(photos);
}
} catch (error) {
console.debug('Error selecting photos:', error);
// You might want to show an error toast here
}
};
return (
<Button
variant={variant}
title={title || t('memo.add_photos_button', 'Add Photos')}
iconName={iconName}
onPress={handlePress}
loading={loading}
disabled={disabled || loading}
style={style}
/>
);
}