Removed timeout when waiting for backend port to allow for slow backend spinups <img width="1185" height="951" alt="image" src="https://github.com/user-attachments/assets/badaf8e5-611d-44aa-aca2-7c1c906c2019" /> <img width="1213" height="1533" alt="image" src="https://github.com/user-attachments/assets/ce78b67a-07e0-4c23-9087-5de0c5f203c6" /> <img width="1207" height="1202" alt="image" src="https://github.com/user-attachments/assets/c6e5b4c5-9cc3-4973-a634-3b7aa1e1dd34" />
73 lines
2.0 KiB
TypeScript
73 lines
2.0 KiB
TypeScript
import React from 'react';
|
|
import { Stack, Button, Text } from '@mantine/core';
|
|
import { useTranslation } from 'react-i18next';
|
|
import CloudIcon from '@mui/icons-material/Cloud';
|
|
import ComputerIcon from '@mui/icons-material/Computer';
|
|
|
|
interface ModeSelectionProps {
|
|
onSelect: (mode: 'saas' | 'selfhosted') => void;
|
|
loading: boolean;
|
|
}
|
|
|
|
export const ModeSelection: React.FC<ModeSelectionProps> = ({ onSelect, loading }) => {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Stack gap="md">
|
|
<Button
|
|
size="xl"
|
|
variant="default"
|
|
onClick={() => onSelect('saas')}
|
|
disabled={loading}
|
|
leftSection={<CloudIcon />}
|
|
styles={{
|
|
root: {
|
|
height: 'auto',
|
|
padding: '1.25rem',
|
|
},
|
|
inner: {
|
|
justifyContent: 'flex-start',
|
|
},
|
|
section: {
|
|
marginRight: '1rem',
|
|
},
|
|
}}
|
|
>
|
|
<div style={{ textAlign: 'left', flex: 1 }}>
|
|
<Text fw={600} size="md">{t('setup.mode.saas.title', 'Use SaaS')}</Text>
|
|
<Text size="sm" c="dimmed" fw={400}>
|
|
{t('setup.mode.saas.description', 'Sign in to Stirling PDF cloud service')}
|
|
</Text>
|
|
</div>
|
|
</Button>
|
|
|
|
<Button
|
|
size="xl"
|
|
variant="default"
|
|
onClick={() => onSelect('selfhosted')}
|
|
disabled={loading}
|
|
leftSection={<ComputerIcon />}
|
|
styles={{
|
|
root: {
|
|
height: 'auto',
|
|
padding: '1.25rem',
|
|
},
|
|
inner: {
|
|
justifyContent: 'flex-start',
|
|
},
|
|
section: {
|
|
marginRight: '1rem',
|
|
},
|
|
}}
|
|
>
|
|
<div style={{ textAlign: 'left', flex: 1 }}>
|
|
<Text fw={600} size="md">{t('setup.mode.selfhosted.title', 'Self-Hosted Server')}</Text>
|
|
<Text size="sm" c="dimmed" fw={400}>
|
|
{t('setup.mode.selfhosted.description', 'Connect to your own Stirling PDF server with your personal account')}
|
|
</Text>
|
|
</div>
|
|
</Button>
|
|
</Stack>
|
|
);
|
|
};
|