>({});
const {previewServerState: ctx} = useContext(StudioServerConnectionCtx);
- const selectedPackages = (Object.keys(map) as InstallablePackage[]).filter(
- (pkg) => map[pkg],
- );
+ const selectedPackages = Object.keys(map).filter((pkg) => map[pkg]);
const onClick = useCallback(async () => {
if (state.type === 'done') {
@@ -151,40 +118,43 @@ export const InstallPackageModal: React.FC<{
) : (
- {listOfInstallableRemotionPackages.map((pkg) => {
- const isInstalled =
- window.remotion_installedPackages?.includes(pkg) ?? false;
- const link = apiDocs[pkg.replace('@remotion/', '') as Pkgs];
- const description =
- descriptions[pkg.replace('@remotion/', '') as Pkgs];
- if (!link) {
- throw new Error('No link for ' + pkg);
- }
-
- if (!description) {
- throw new Error('No description for ' + pkg);
- }
-
- return (
-
- {
- setMap((prev) => ({...prev, [pkg]: !prev[pkg]}));
- }}
- disabled={!canSelectPackages || isInstalled}
- />
-
-
-
- );
- })}
+ {Object.entries(installableMap)
+ .filter(([, install]) => install)
+ .map(([pkgShort]) => {
+ const pkg =
+ pkgShort === 'core' ? 'remotion' : `@remotion/${pkgShort}`;
+ const isInstalled =
+ window.remotion_installedPackages?.includes(pkg) ?? false;
+ const link = apiDocs[pkgShort as Pkgs];
+ const description = descriptions[pkgShort as Pkgs];
+ if (!link) {
+ throw new Error('No link for ' + pkg);
+ }
+
+ if (!description) {
+ throw new Error('No description for ' + pkg);
+ }
+
+ return (
+
+ {
+ setMap((prev) => ({...prev, [pkg]: !prev[pkg]}));
+ }}
+ disabled={!canSelectPackages || isInstalled}
+ />
+
+
+
+ );
+ })}
)}