import { StatusWaitingIcon } from '@expo/styleguide-icons'; import { ElementType } from '~/types/common'; import { NoIcon, YesIcon } from '~/ui/components/DocIcons'; import { Cell, HeaderCell, Row, Table, TableHead, TableLayout } from '~/ui/components/Table'; import { A, H4 } from '~/ui/components/Text'; const platforms = [ { title: 'Android Device', propName: 'android' }, { title: 'Android Emulator', propName: 'emulator' }, { title: 'iOS Device', propName: 'ios' }, { title: 'iOS Simulator', propName: 'simulator' }, { title: 'Web', propName: 'web' }, ]; type Platform = ElementType; type IsSupported = boolean | undefined | { pending: string }; function getInfo(isSupported: IsSupported, { title }: Platform) { if (isSupported === true) { return { children: , title: `${title} is supported`, }; } else if (typeof isSupported === 'object') { return { children: ( Pending ), title: `${title} support is pending`, }; } return { children: , title: `${title} is not supported`, }; } type Props = { title?: string; ios?: boolean; android?: boolean; web?: boolean; simulator?: boolean; emulator?: boolean; }; type PlatformProps = Omit; const PlatformsSection = (props: Props) => ( <>

{props.title || 'Platform Compatibility'}

{platforms.map(({ title }) => ( {title} ))} {platforms.map(platform => ( ))}
); export default PlatformsSection;