shlink-web-client/src/short-urls/helpers/CreateShortUrlResult.js

19 lines
437 B
JavaScript
Raw Normal View History

import React from 'react';
import { isNil } from 'ramda';
2018-07-28 19:59:32 +03:00
export default function CreateShortUrlResult ({ loading, error, result }) {
if (loading) {
return <div className="text-center">Loading...</div>
}
2018-07-28 19:59:32 +03:00
if (error) {
return <div className="text-center color-danger">An error occurred while creating the URL :(</div>
}
2018-07-28 19:59:32 +03:00
if (isNil(result)) {
return null;
}
return <div className="text-center">Great!</div>;
};