feat: expand camera analysis display with new fields
- Added distilled date, bottled date, and batch info to the analysis result summary in CameraCapture - These fields now appear only if Gemini successfully identifies them from the photo
This commit is contained in:
@@ -463,6 +463,24 @@ export default function CameraCapture({ onImageCaptured, onAnalysisComplete, onS
|
||||
<span className="text-zinc-500">{t('bottle.abvLabel')}:</span>
|
||||
<span className="font-semibold">{analysisResult.abv ? `${analysisResult.abv}%` : '-'}</span>
|
||||
</div>
|
||||
{analysisResult.distilled_at && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-zinc-500">{t('bottle.distilledLabel')}:</span>
|
||||
<span className="font-semibold">{analysisResult.distilled_at}</span>
|
||||
</div>
|
||||
)}
|
||||
{analysisResult.bottled_at && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-zinc-500">{t('bottle.bottledLabel')}:</span>
|
||||
<span className="font-semibold">{analysisResult.bottled_at}</span>
|
||||
</div>
|
||||
)}
|
||||
{analysisResult.batch_info && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-zinc-500">{t('bottle.batchLabel')}:</span>
|
||||
<span className="font-semibold">{analysisResult.batch_info}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -9,7 +9,9 @@ export async function updateBottleStatus(bottleId: string, status: 'sealed' | 'o
|
||||
|
||||
try {
|
||||
const { data: { session } } = await supabase.auth.getSession();
|
||||
if (!session) throw new Error('Nicht autorisiert');
|
||||
if (!session) {
|
||||
throw new Error('Nicht autorisiert');
|
||||
}
|
||||
|
||||
const { error } = await supabase
|
||||
.from('bottles')
|
||||
@@ -21,7 +23,9 @@ export async function updateBottleStatus(bottleId: string, status: 'sealed' | 'o
|
||||
.eq('id', bottleId)
|
||||
.eq('user_id', session.user.id);
|
||||
|
||||
if (error) throw error;
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
revalidatePath(`/bottles/${bottleId}`);
|
||||
revalidatePath('/');
|
||||
@@ -29,6 +33,7 @@ export async function updateBottleStatus(bottleId: string, status: 'sealed' | 'o
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('Update Status Error:', error);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Fehler beim Aktualisieren des Status',
|
||||
|
||||
Reference in New Issue
Block a user