Fix TypeScript typecheck errors
This commit is contained in:
@@ -108,12 +108,13 @@ function SectionHeader({
|
||||
|
||||
function StatusBadge({ status }: { status: string }) {
|
||||
const { t } = useTranslation('management');
|
||||
const config =
|
||||
{
|
||||
published: { tone: 'success', label: t('events.status.published', 'Live') },
|
||||
draft: { tone: 'warning', label: t('events.status.draft', 'Draft') },
|
||||
archived: { tone: 'muted', label: t('events.status.archived', 'Archived') },
|
||||
}[status] || { tone: 'muted', label: status };
|
||||
type StatusTone = 'success' | 'warning' | 'danger' | 'muted';
|
||||
const statuses: Record<string, { tone: StatusTone; label: string }> = {
|
||||
published: { tone: 'success', label: t('events.status.published', 'Live') },
|
||||
draft: { tone: 'warning', label: t('events.status.draft', 'Draft') },
|
||||
archived: { tone: 'muted', label: t('events.status.archived', 'Archived') },
|
||||
};
|
||||
const config = statuses[status] ?? { tone: 'muted', label: status };
|
||||
|
||||
return <PillBadge tone={config.tone}>{config.label}</PillBadge>;
|
||||
}
|
||||
@@ -408,7 +409,7 @@ function LifecycleHero({
|
||||
<DashboardCard variant={cardVariant} padding={cardPadding}>
|
||||
<YStack space={isEmbedded ? '$2.5' : '$3'}>
|
||||
<XStack alignItems="center" space="$2.5">
|
||||
<YStack width={40} height={40} borderRadius={20} backgroundColor={theme.success} alignItems="center" justifyContent="center">
|
||||
<YStack width={40} height={40} borderRadius={20} backgroundColor={theme.successText} alignItems="center" justifyContent="center">
|
||||
<CheckCircle2 size={20} color="white" />
|
||||
</YStack>
|
||||
<YStack>
|
||||
@@ -486,7 +487,7 @@ function LifecycleHero({
|
||||
</Text>
|
||||
<Switch
|
||||
checked={published}
|
||||
onCheckedChange={(checked) => handlePublishChange(Boolean(checked))}
|
||||
onCheckedChange={(checked: boolean) => handlePublishChange(Boolean(checked))}
|
||||
size="$2"
|
||||
disabled={isPublishing}
|
||||
aria-label={t('eventForm.fields.publish.label', 'Publish immediately')}
|
||||
@@ -625,26 +626,27 @@ function UnifiedToolGrid({ event, navigate, permissions, isMember, isCompleted }
|
||||
const { t } = useTranslation(['management', 'dashboard']);
|
||||
const slug = event?.slug;
|
||||
if (!slug) return null;
|
||||
type ToolItem = { label: string; icon: any; path: string; color?: string };
|
||||
|
||||
const experienceItems = [
|
||||
const experienceItems: ToolItem[] = [
|
||||
{ label: t('management:photos.gallery.title', 'Photos'), icon: ImageIcon, path: `/mobile/events/${slug}/control-room`, color: theme.primary },
|
||||
!isCompleted ? { label: t('management:events.quick.liveShowSettings', 'Slide Show'), icon: Tv, path: `/mobile/events/${slug}/live-show/settings`, color: '#F59E0B' } : null,
|
||||
!isCompleted ? { label: t('events.tasks.badge', 'Photo tasks'), icon: ListTodo, path: `/mobile/events/${slug}/tasks`, color: theme.accent } : null,
|
||||
!isCompleted ? { label: t('management:events.quick.photobooth', 'Photobooth'), icon: Camera, path: `/mobile/events/${slug}/photobooth`, color: '#8B5CF6' } : null,
|
||||
].filter((item): item is { label: string; icon: any; path: string; color?: string } => Boolean(item));
|
||||
].filter(Boolean) as ToolItem[];
|
||||
|
||||
const operationsItems = [
|
||||
const operationsItems: ToolItem[] = [
|
||||
!isCompleted ? { label: t('management:invites.badge', 'QR Codes'), icon: QrCode, path: `/mobile/events/${slug}/qr`, color: '#10B981' } : null,
|
||||
{ label: t('management:events.quick.guests', 'Guests'), icon: Users, path: `/mobile/events/${slug}/members`, color: ADMIN_ACTION_COLORS.guests },
|
||||
!isCompleted ? { label: t('management:events.quick.guestMessages', 'Messages'), icon: Megaphone, path: `/mobile/events/${slug}/guest-notifications`, color: ADMIN_ACTION_COLORS.guestMessages } : null,
|
||||
!isCompleted ? { label: t('events.branding.titleShort', 'Branding'), icon: Layout, path: `/mobile/events/${slug}/branding`, color: ADMIN_ACTION_COLORS.branding } : null,
|
||||
].filter((item): item is { label: string; icon: any; path: string; color?: string } => Boolean(item));
|
||||
].filter(Boolean) as ToolItem[];
|
||||
|
||||
const adminItems = [
|
||||
const adminItems: ToolItem[] = [
|
||||
{ label: t('management:mobileDashboard.shortcutAnalytics', 'Analytics'), icon: TrendingUp, path: `/mobile/events/${slug}/analytics`, color: ADMIN_ACTION_COLORS.analytics },
|
||||
!isCompleted ? { label: t('events.recap.exportTitleShort', 'Exports'), icon: Download, path: `/mobile/exports`, color: ADMIN_ACTION_COLORS.recap } : null,
|
||||
{ label: t('management:mobileProfile.settings', 'Settings'), icon: Settings, path: `/mobile/events/${slug}/edit`, color: ADMIN_ACTION_COLORS.settings },
|
||||
].filter((item): item is { label: string; icon: any; path: string; color?: string } => Boolean(item));
|
||||
].filter(Boolean) as ToolItem[];
|
||||
|
||||
const sections = [
|
||||
{
|
||||
@@ -719,11 +721,11 @@ function UnifiedToolGrid({ event, navigate, permissions, isMember, isCompleted }
|
||||
);
|
||||
}
|
||||
|
||||
function RecentPhotosSection({ photos, navigate, slug }: { photos: TenantPhoto[], navigate: any, slug: string }) {
|
||||
function RecentPhotosSection({ photos, navigate, slug }: { photos: TenantPhoto[]; navigate: any; slug?: string }) {
|
||||
const theme = useAdminTheme();
|
||||
const { t } = useTranslation('management');
|
||||
|
||||
if (!photos.length) return null;
|
||||
if (!photos.length || !slug) return null;
|
||||
|
||||
return (
|
||||
<DashboardCard>
|
||||
|
||||
Reference in New Issue
Block a user