import clsx from 'clsx';
import { PM_ADD, PMS, useCopy, usePackageManager } from './hooks';
import styles from './InstallCommand.module.css';
import ui from './ui.module.css';
export const PACKAGES = 'react-native-codepad react-native-nitro-modules';
export function PmTabs({ className, hero }: { className?: string; hero?: boolean }) {
const [pm, setPm] = usePackageManager();
return (
{PMS.map((id) => (
))}
);
}
export function CopyIcon({ copied }: { copied: boolean }) {
return copied ? (
) : (
);
}
// The hero's install line: the selected package manager's add command and a copy button.
export function InstallBox() {
const [pm] = usePackageManager();
const [copied, copy] = useCopy();
const command = `${PM_ADD[pm]} ${PACKAGES}`;
return (
$
{/* biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard (axe scrollable-region-focusable) */}
{command}