import { PropsWithChildren } from 'react';
import { usePageMetadata } from '~/providers/page-metadata';
import { Terminal } from '~/ui/components/Snippet';
import { A, P, DEMI } from '~/ui/components/Text';
type InstallSectionProps = PropsWithChildren<{
packageName: string;
hideBareInstructions?: boolean;
cmd?: string[];
href?: string;
}>;
const getPackageLink = (packageNames: string) =>
`https://github.com/expo/expo/tree/main/packages/${packageNames.split(' ')[0]}`;
const getInstallCmd = (packageName: string) => `$ npx expo install ${packageName}`;
const InstallSection = ({
packageName,
hideBareInstructions = false,
cmd = [getInstallCmd(packageName)],
href = getPackageLink(packageName),
}: InstallSectionProps) => {
const { sourceCodeUrl } = usePageMetadata();
return (
<>
If you're installing this in a bare React Native app, you
should also follow{' '}