import { caissonFaq } from './caissons';
import { sizeAnswer } from './limits';
export type HelpTopic = { id: 'account' | 'git' | 'caissons' | 'moving' | 'billing' | 'privacy'; title: string; blurb: string };
export type HelpArticle = { topic: HelpTopic['id']; q: string; a: string; link?: { href: string; label: string } };
export const topics: HelpTopic[] = [
{ id: 'account', title: 'Signing in', blurb: 'Passwords, two-factor codes and your email' },
{ id: 'git', title: 'Git and SSH', blurb: 'Keys, pushing, cloning and the sf tool' },
{ id: 'caissons', title: 'Caissons', blurb: 'Agents editing the repository on Sailfork' },
{ id: 'moving', title: 'Moving to Sailfork', blurb: 'From GitHub, GitLab, Bitbucket or a server' },
{ id: 'billing', title: 'Billing', blurb: 'Plans, cards, bank accounts and invoices' },
{ id: 'privacy', title: 'Privacy and data', blurb: 'Where code lives and what we keep' }
];
export const articles: HelpArticle[] = [
{ topic: 'account', q: 'I forgot my password', a: 'Choose “Forgot your password?” on the sign-in page and enter your email. The link we send works once, for one hour, and changing the password signs you out everywhere else.', link: { href: '/forgot-password', label: 'Reset your password' } },
{ topic: 'account', q: 'My reset link says it expired', a: 'Links last one hour, and only the newest one works. Ask for a new link and open the latest email.', link: { href: '/forgot-password', label: 'Send a new link' } },
{ topic: 'account', q: 'I lost my authenticator', a: 'Sign in with one of the ten recovery codes you saved when you turned on two-factor sign-in, then set up the authenticator again. Each code works once.' },
{ topic: 'account', q: 'I signed up with GitHub and have no password', a: 'Keep using “Sign in with GitHub”. There is no Sailfork password to reset until you set one in Settings.' },
{ topic: 'account', q: 'Change the email on my account', a: 'In Settings, under Account, add the new address, open the verification email, then make it your primary address. Unverified addresses never receive mail.', link: { href: '/settings/account', label: 'Open account settings' } },
{ topic: 'account', q: 'Delete my account', a: 'Send a message through the contact page. Your account, repositories and personal data are deleted, except what the law requires keeping.', link: { href: '/contact', label: 'Contact us' } },
{ topic: 'git', q: 'Which SSH keys work?', a: 'ed25519 and ECDSA. RSA and DSA keys are refused, so make a new one with ssh-keygen -t ed25519 if yours is older.' },
{ topic: 'git', q: 'Do I need a special client?', a: 'No. Sailfork speaks the normal git protocol over HTTPS and SSH. Add it as a remote and push.' },
{ topic: 'git', q: 'How big can a repository be?', a: `${sizeAnswer} Push larger histories in parts.` },
{ topic: 'git', q: 'Install the sf command-line tool', a: 'Run curl -fsSL https://sailfork.com/downloads/sf/install.sh | sh. It handles sign-in, repositories, SSH keys and tokens.' },
...caissonFaq.map((f) => ({ topic: 'caissons' as const, q: f.q, a: f.a, link: { href: '/caissons', label: 'How caissons work' } })),
{ topic: 'moving', q: 'Move from GitHub', a: 'Authorize GitHub, pick repositories or whole organizations, and we copy code, issues and pull requests. Nothing changes on GitHub.', link: { href: '/migrate', label: 'Start a move' } },
{ topic: 'moving', q: 'Move from GitLab, Bitbucket or Azure DevOps', a: 'Paste the repositories into the migrate page and run the script it writes. It copies every branch and tag and checks nothing was left behind.', link: { href: '/migrate#script', label: 'Write the script' } },
{ topic: 'moving', q: 'Do commit hashes change?', a: 'No. History is copied as it is, so hashes, signatures and links to commits keep working.' },
{ topic: 'billing', q: 'Change the card or bank account we pay with', a: 'In Settings, under Billing, add the new card or bank account and make it the default. The old one stays until you remove it.', link: { href: '/settings/billing', label: 'Open billing' } },
{ topic: 'billing', q: 'Pay by invoice', a: 'Enterprise plans can pay by invoice with net terms. Tell us your billing contact and we set it up.', link: { href: '/contact', label: 'Ask for invoicing' } },
{ topic: 'privacy', q: 'Where is my code stored?', a: 'On Amazon Web Services in the us-east-2 (Ohio) region. Email, such as verification and password resets, goes through Amazon SES.' },
{ topic: 'privacy', q: 'Do you track me?', a: 'No. Sailfork sets one session cookie when you sign in. There are no advertising or tracking cookies and no analytics scripts.' },
{ topic: 'privacy', q: 'Is there an uptime guarantee?', a: 'No. Sailfork is provided as is. Keep your own copy of anything you cannot afford to lose; with git, you already have one.' }
];