PluginCard.tsx 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // import { faCircleArrowDown, faCircleCheck } from '@fortawesome/free-solid-svg-icons';
  2. // import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
  3. import Link from 'next/link';
  4. import styles from './PluginCard.module.scss';
  5. type Props = {
  6. name: string,
  7. url: string,
  8. description: string,
  9. }
  10. export const PluginCard = (props: Props): JSX.Element => {
  11. const {
  12. name, url, description,
  13. } = props;
  14. // const [isEnabled, setIsEnabled] = useState(true);
  15. // const checkboxHandler = useCallback(() => {
  16. // setIsEnabled(false);
  17. // }, []);
  18. return (
  19. <div className="card shadow border-0" key={name}>
  20. <div className="card-body px-5 py-4 mt-3">
  21. <div className="row mb-3">
  22. <div className="col-9">
  23. <h2 className="card-title h3 border-bottom pb-2 mb-3">
  24. <Link href={`${url}`}>{name}</Link>
  25. </h2>
  26. <p className="card-text text-muted">{description}</p>
  27. </div>
  28. <div className='col-3'>
  29. <div className={`${styles.plugin_card}`}>
  30. <div className="switch">
  31. <label className="switch__label">
  32. <input type="checkbox" className="switch__input" checked/>
  33. <span className="switch__content"></span>
  34. <span className="switch__circle"></span>
  35. </label>
  36. </div>
  37. </div>
  38. {/* <div className="custom-control custom-switch custom-switch-lg custom-switch-slack">
  39. <input
  40. type="checkbox"
  41. className="custom-control-input border-0"
  42. checked={isEnabled}
  43. onChange={checkboxHandler}
  44. />
  45. <label className="custom-control-label align-center"></label>
  46. </div> */}
  47. {/* <Image className="mx-auto" alt="GitHub avator image" src={owner.avatar_url} width={250} height={250} /> */}
  48. </div>
  49. </div>
  50. <div className="row">
  51. <div className="col-12 d-flex flex-wrap gap-2">
  52. {/* {topics?.map((topic: string) => {
  53. return (
  54. <span key={`${name}-${topic}`} className="badge rounded-1 mp-bg-light-blue text-dark fw-normal">
  55. {topic}
  56. </span>
  57. );
  58. })} */}
  59. </div>
  60. </div>
  61. </div>
  62. <div className="card-footer px-5 border-top-0 mp-bg-light-blue">
  63. <p className="d-flex justify-content-between align-self-center mb-0">
  64. <span>
  65. {/* {owner.login === 'weseek' ? <FontAwesomeIcon icon={faCircleCheck} className="me-1 text-primary" /> : <></>}
  66. <a href={owner.html_url} target="_blank" rel="noreferrer">
  67. {owner.login}
  68. </a> */}
  69. </span>
  70. {/* <span>
  71. <FontAwesomeIcon icon={faCircleArrowDown} className="me-1" /> {stargazersCount}
  72. </span> */}
  73. </p>
  74. </div>
  75. </div>
  76. );
  77. };