import { appInstallationStatusMessages } from "@dashboard/apps/messages"; import { IS_CLOUD_INSTANCE } from "@dashboard/config"; import { AppInstallationFragment } from "@dashboard/graphql"; import { buttonMessages } from "@dashboard/intl"; import { Tooltip } from "@material-ui/core"; import { Box, Button, Text } from "@saleor/macaw-ui/next"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import InstallErrorAction from "./ErrorInstallAction"; import { messages } from "./messages"; interface AppListCardActionsProps { releaseDate: string | undefined; installationPending?: boolean; appInstallation?: AppInstallationFragment; installHandler?: () => void; githubForkHandler?: () => void; retryInstallHandler?: () => void; removeInstallHandler?: () => void; } const AppListCardActions: React.FC = ({ releaseDate, installationPending = false, appInstallation, installHandler, githubForkHandler, retryInstallHandler, removeInstallHandler, }) => { const intl = useIntl(); if ( !installHandler && !githubForkHandler && !releaseDate && !retryInstallHandler && !removeInstallHandler && !installationPending ) { return null; } return ( {githubForkHandler && ( )} {installHandler && IS_CLOUD_INSTANCE && ( )} {installHandler && !IS_CLOUD_INSTANCE && (
)} {installationPending && ( )} {releaseDate && ( )}
); }; AppListCardActions.displayName = "AppListCardActions"; export default AppListCardActions;