import React from "react"; import { AppId } from "./apps-config"; export const appSquareWidthExpression = "max(min(11vw,180px),80px)"; export const appSquarePaddingExpression = "max(min(1vw,1.5rem),0.25rem)"; export type AppIconProps = { appId: AppId, /** * Icon component from the app frontend config */ IconComponent: React.FunctionComponent>, /** * Optional logo component from the app frontend config */ LogoComponent?: React.FunctionComponent<{}>, className?: string, /** * Whether this app is enabled/installed (shows green icon) */ enabled?: boolean, /** * Whether this app is disabled (shows dashed border) */ disabled?: boolean, style?: React.CSSProperties, /** * cn utility function for className merging (e.g., from stack-ui or tailwind-merge) */ cn: (...inputs: any[]) => string, }; export function AppIcon({ appId, IconComponent, LogoComponent, className, enabled = false, disabled, style, cn, }: AppIconProps) { const filterId = "glow-fx"; return ( <> {/* theoretically, this only needs to be in the dom once: */} {/* drop shadow */} {/* outer shadow */} {/* Combine: drop shadow behind, then outer shadow, then source graphic on top */}
{LogoComponent ? (
) : ( )}
); }