nodebb-plugin-ns-embed
Version:
Embed media and rich content in posts: youtube, vimeo, twitch etc. All embeds are based on the rules. You are encouraged to build your own rules to embed everything what is embeddable.
29 lines (24 loc) • 982 B
JavaScript
import React from 'react';
import {FormActions} from './form-actions';
import {isRuleValid} from '../util/is-rule-valid';
import {RuleForm} from './rule-form';
export const RuleCreate = props => {
let valid = isRuleValid(props.rule.name, props.rule.displayName, props.rule.regex, props.rule.replacement);
return (
<div className="card">
<div className="card-header">Create Rule</div>
<div className="card-body">
<RuleForm
propDidChange={(property, value) => props.newRuleFieldWillChange(property, value)}
{...props}/>
<FormActions
okButton="Create"
okButtonClick={() => props.ruleWillCreate()}
okValid={valid}
warningButton="Reset"
warningButtonClick={() => props.ruleWillReset()}
warningValid={true}/>
</div>
</div>
);
}