fix(admin): refine dashboard translations and label mapping
- Mapped 'Photobooth' and 'Guests' grid items to correct translation keys - Localized pulse strip labels (Fotos, Gäste) - Updated readiness hook to use translated CTAs
This commit is contained in:
@@ -19,7 +19,8 @@ export type ReadinessStatus = {
|
||||
isReady: boolean;
|
||||
};
|
||||
|
||||
export function useEventReadiness(event: TenantEvent | null): ReadinessStatus {
|
||||
// We pass `t` (translation function) to localise the return values
|
||||
export function useEventReadiness(event: TenantEvent | null, t: (key: string, fallback?: string) => string): ReadinessStatus {
|
||||
if (!event) {
|
||||
return { steps: [], totalSteps: 0, completedSteps: 0, progress: 0, nextStep: null, isReady: false };
|
||||
}
|
||||
@@ -39,36 +40,35 @@ export function useEventReadiness(event: TenantEvent | null): ReadinessStatus {
|
||||
const hasTasks = (event.tasks_count ?? 0) > 0;
|
||||
|
||||
// 3. Access: QR / Invites
|
||||
// We consider it "done" if there is at least one active invite token (default is created on event creation usually, but let's check)
|
||||
const hasInvite = (event.active_invites_count ?? 0) > 0 || (event.total_invites_count ?? 0) > 0;
|
||||
|
||||
const steps: ReadinessStep[] = [
|
||||
{
|
||||
id: 'basics',
|
||||
label: 'Date & Location',
|
||||
label: t('management:events.form.date', 'Date & Location'),
|
||||
isComplete: hasDate && hasLocation,
|
||||
ctaLabel: 'Set Date & Location',
|
||||
ctaLabel: t('management:events.actions.edit', 'Set Date & Location'),
|
||||
targetPath: `/mobile/events/${event.slug}/edit`,
|
||||
priority: 1
|
||||
},
|
||||
{
|
||||
id: 'access',
|
||||
label: 'QR Codes',
|
||||
label: t('management:invites.badge', 'QR Codes'),
|
||||
ctaLabel: t('management:invites.actions.create', 'Get QR Code'),
|
||||
isComplete: hasInvite,
|
||||
ctaLabel: 'Get QR Code',
|
||||
targetPath: `/mobile/events/${event.slug}/qr`,
|
||||
priority: 3 // Access is usually needed after setup
|
||||
priority: 3
|
||||
}
|
||||
];
|
||||
|
||||
if (tasksEnabled) {
|
||||
steps.push({
|
||||
id: 'tasks',
|
||||
label: 'Photo Tasks',
|
||||
label: t('management:tasks.badge', 'Photo Tasks'),
|
||||
isComplete: hasTasks,
|
||||
ctaLabel: 'Add Photo Tasks',
|
||||
ctaLabel: t('management:tasks.actions.assign', 'Add Photo Tasks'),
|
||||
targetPath: `/mobile/events/${event.slug}/tasks`,
|
||||
priority: 2 // Content comes before distribution
|
||||
priority: 2
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user