import { AlertTriangleIcon, CrownIcon, HardDriveUploadIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Switch } from '@/components/ui/switch' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { usePicGoCloudBillingQuery } from '@/queries/picgo-cloud-billing' import { CloudCardShell } from './cloud-card-shell' interface CloudAutoImportCardProps { checked: boolean disabled: boolean isPaidUser: boolean onCheckedChange: (checked: boolean) => Promise } export function CloudAutoImportCard ({ checked, disabled, isPaidUser, onCheckedChange }: CloudAutoImportCardProps) { const { t } = useTranslation() const { data: billing } = usePicGoCloudBillingQuery() const disabledByLifecycle = billing?.lifecycle?.flags?.autoImportDisabledByLifecycle ?? false const switchDisabled = disabled || disabledByLifecycle return (
{t('PICGO_CLOUD_AUTO_IMPORT_LABEL')} {!isPaidUser ? (

{t('ALBUM_CLOUD_UPGRADE_DESC')}

) : disabledByLifecycle ? (

{t('PICGO_CLOUD_AUTO_IMPORT_DISABLED_BY_LIFECYCLE')}

) : null}

{t('PICGO_CLOUD_AUTO_IMPORT_DESC')}

{ await onCheckedChange(nextChecked) }} disabled={switchDisabled} />
) }