mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-17 05:07:08 +02:00
Split codebase (#455)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { appInfo } from "../lib/appInfo";
|
||||
|
||||
interface Props {
|
||||
children: ReactNode;
|
||||
feature: "updater" | "license";
|
||||
}
|
||||
|
||||
const featureMap: Record<Props["feature"], boolean> = {
|
||||
updater: appInfo.featureUpdater,
|
||||
license: appInfo.featureLicense,
|
||||
};
|
||||
|
||||
export function CargoFeature({ children, feature }: Props) {
|
||||
if (featureMap[feature]) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user