import React from 'react' import { Box, HStack } from '../elements/LayoutPrimitives' import { StyledText, StyledAnchor } from '../elements/StyledText' import { AngleDownIcon } from '../tokens/icons/AngleDownIcon' import { Button } from './Button' import { Dropdown, DropdownOption, DropdownSeparator } from './DropdownElements' import { ChromeIcon } from './images/ChromeIcon' import { EdgeIcon } from './images/EdgeIcon' import { FirefoxIcon } from './images/FirefoxIcon' import { SafariIcon } from './images/SafariIcon' import Link from 'next/link' const icons = { 'Google Chrome': , 'Microsoft Edge': , Firefox: , Safari: , } const extensionDownloadLinks = { 'Google Chrome': 'https://omnivore.app/install/chrome', Safari: 'https://omnivore.app/install/mac', 'Microsoft Edge': 'https://omnivore.app/install/edge', Firefox: 'https://omnivore.app/install/firefox', } const browserOptions = [ 'Google Chrome', 'Firefox', 'Microsoft Edge', 'Safari', ] as const type browserType = typeof browserOptions[number] const BrowserOption: React.FC<{ browser: browserType }> = ({ browser }) => { return ( {icons[browser as browserType]} {browser} ) } type ExtensionsInstallHelpProps = { onboarding?: boolean } export default function ExtensionsInstallHelp({ onboarding = false, }: ExtensionsInstallHelpProps): JSX.Element { const [browserValue, setBrowserValue] = React.useState( browserOptions[0] ) return ( Install Browser Extensions Installing the Omnivore browser extension is the best way to save pages to Omnivore from your computer.
{!onboarding && ( Learn more about the browser extension -> )}
{icons[browserValue]} {browserValue} } > {browserOptions.map((item, idx) => (
setBrowserValue(item)}> {idx !== browserOptions.length - 1 && ( )}
))}
) }