2018-07-10 10:08:42 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { registerComponent } from 'meteor/vulcan:core';
|
|
|
|
|
2018-08-07 15:37:51 +09:00
|
|
|
const parseUrl = value => {
|
2018-11-30 15:59:27 +09:00
|
|
|
return value && value.toString().slice(0,4) === 'http' ? <a href={value} target="_blank">{value}</a> : value;
|
2018-08-07 15:37:51 +09:00
|
|
|
}
|
|
|
|
|
2018-07-10 10:08:42 +02:00
|
|
|
const StaticComponent = ({ value, label }) => (
|
|
|
|
<div className="form-group row">
|
|
|
|
<label className="control-label col-sm-3">{label}</label>
|
2018-08-07 15:37:51 +09:00
|
|
|
<div className="col-sm-9">{parseUrl(value)}</div>
|
2018-07-10 10:08:42 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
registerComponent('FormComponentStaticText', StaticComponent);
|