import React from "react"; import { BusyMessage } from "component/common"; import Link from "component/link"; import { FormRow } from "component/form.js"; class FormInviteNew extends React.PureComponent { constructor(props) { super(props); this.state = { email: "", }; } handleEmailChanged(event) { this.setState({ email: event.target.value, }); } handleSubmit(event) { event.preventDefault(); this.props.inviteNew(this.state.email); } render() { const { errorMessage, isPending } = this.props; return (
{ this.handleEmailChanged(event); }} />
{ this.handleSubmit(event); }} />
); } } class InviteNew extends React.PureComponent { render() { const { errorMessage, invitesRemaining, inviteNew, inviteStatusIsPending, isPending, } = this.props; return (

{__( "Invite a Friend (or Enemy) (or Someone You Are Somewhat Ambivalent About)" )}

{invitesRemaining > 0 &&

{__("You have %s invites remaining.", invitesRemaining)}

} {invitesRemaining <= 0 &&

{__("You have no invites.", invitesRemaining)}

}
{!inviteStatusIsPending && invitesRemaining > 0 &&
}
); } } export default InviteNew;