// @flow import type { Node } from 'react'; import type { OauthAppResponse } from 'services/api/oauth'; import React, { Component } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; import classNames from 'classnames'; import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui'; import { Input, Button } from 'components/ui/form'; import Collapse from 'components/ui/collapse'; import styles from '../applicationsIndex.scss'; import messages from '../ApplicationsIndex.intl.json'; const ACTION_REVOKE_TOKENS = 'revoke-tokens'; const ACTION_RESET_SECRET = 'reset-secret'; const ACTION_DELETE = 'delete'; const actionButtons = [ { type: ACTION_REVOKE_TOKENS, label: messages.revokeAllTokens }, { type: ACTION_RESET_SECRET, label: messages.resetClientSecret }, { type: ACTION_DELETE, label: messages.delete } ]; export default class ApplicationItem extends Component< { application: OauthAppResponse, expand: bool, onTileClick: string => void, onResetSubmit: (string, bool) => Promise<*>, onDeleteSubmit: string => Promise<*> }, { selectedAction: ?string, isActionPerforming: bool, detailsHeight: number } > { state = { selectedAction: null, isActionPerforming: false, detailsHeight: 0 }; render() { const { application: app, expand } = this.props; const { selectedAction } = this.state; return (