/*
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 { Building2, Home, Presentation } from 'lucide-react'
import type { ComponentType } from 'react'
import type { UseFormReturn } from 'react-hook-form'
import { useTranslation } from 'react-i18next'
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form'
import { Label } from '@/components/ui/label'
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'
import { cn } from '@/lib/utils'
import type { SetupFormValues, SetupUsageMode } from '../types'
interface UsageModeStepProps {
form: UseFormReturn
}
const USAGE_MODE_OPTIONS: Array<{
value: SetupUsageMode
titleKey: string
descriptionKey: string
icon: ComponentType<{ className?: string }>
}> = [
{
value: 'external',
titleKey: 'External operations',
descriptionKey:
'Serve multiple users or teams with billing and quota control.',
icon: Building2,
},
{
value: 'self',
titleKey: 'Personal use',
descriptionKey:
'Best for single-tenant deployments. Pricing and billing options stay hidden.',
icon: Home,
},
{
value: 'demo',
titleKey: 'Demo site',
descriptionKey:
'Showcase core capabilities with demo credentials and limited access.',
icon: Presentation,
},
]
export function UsageModeStep({ form }: UsageModeStepProps) {
const { t } = useTranslation()
return (
(
{t('How will you use the platform?')} {
form.clearErrors('usageMode')
field.onChange(value as SetupUsageMode)
}}
className='grid gap-3 sm:grid-cols-3'
>
{USAGE_MODE_OPTIONS.map(
({ value, titleKey, descriptionKey, icon: Icon }) => {
return (
)
}
)}
)}
/>
)
}