/*
Copyright (C) 2023-2026 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
For commercial licensing, please contact support@quantumnous.com
*/
import { CheckCircle2 } from 'lucide-react'
import { useTranslation } from 'react-i18next'
import { StatusBadge } from '@/components/status-badge'
import { Separator } from '@/components/ui/separator'
import type { SetupFormValues, SetupStatus } from '../types'
interface CompleteStepProps {
status?: SetupStatus
values: SetupFormValues
}
const USAGE_MODE_LABEL_KEYS: Record = {
external: 'External operations mode',
self: 'Personal use mode',
demo: 'Demo site mode',
}
const DATABASE_VARIANT: Record<
string,
'info' | 'success' | 'warning' | 'neutral'
> = {
sqlite: 'warning',
mysql: 'success',
postgres: 'success',
}
export function CompleteStep({ status, values }: CompleteStepProps) {
const { t } = useTranslation()
const usageLabelKey = USAGE_MODE_LABEL_KEYS[values.usageMode]
const dbType = status?.database_type ?? 'Unknown'
const databaseVariant = DATABASE_VARIANT[dbType.toLowerCase()] ?? 'neutral'
return (
{t('Ready to initialize')}
{t(
'Double check the configuration below. Your system will be locked until initialization is complete.'
)}
{t('Database')}
{dbType}
{t('Administrator account')}
{status?.root_init
? t('Existing account will be reused')
: values.username || t('Not set yet')}