story.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* eslint-disable react/jsx-props-no-spreading */
  2. /*
  3. Copyright (C) 2017 Cloudbase Solutions SRL
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as
  6. published by the Free Software Foundation, either version 3 of the
  7. License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. import React from "react";
  16. import { storiesOf } from "@storybook/react";
  17. import EndpointDetailsContent from ".";
  18. const item: any = {
  19. name: "Name",
  20. type: "openstack",
  21. description: "Description",
  22. created_at: new Date(),
  23. };
  24. const connectionInfo: any = {
  25. username: "username",
  26. password: "password123",
  27. details: "other details",
  28. };
  29. const props: any = {};
  30. storiesOf("EndpointDetailsContent", module)
  31. .add("connection info loading", () => (
  32. <EndpointDetailsContent item={item} loading {...props} />
  33. ))
  34. .add("with connection info", () => (
  35. <EndpointDetailsContent
  36. item={item}
  37. connectionInfo={connectionInfo}
  38. {...props}
  39. />
  40. ));