All files / applications/go-by-transit/src/component/buttons RemoveBookmarkSectionButton.tsx

100% Statements 4/4
100% Branches 2/2
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                  3x 2x       5x     10x                  
import { Button } from "@wintermuted/ui-react";
import React from "react";
import FontAwesome from "react-fontawesome";
 
interface RemoveBookmarkSectionButtonProps {
  removeBookmarkSection: () => void;
}
 
function confirmDeletion(removeBookmarkSection) {
  if (window.confirm("Are you sure you want to remove this section?")) {
    removeBookmarkSection();
  }
}
 
export const RemoveBookmarkSectionButton = ({
  removeBookmarkSection
}: RemoveBookmarkSectionButtonProps) => {
  return (
    <Button
      onClick={confirmDeletion.bind(this, removeBookmarkSection)}
      title="Remove Bookmark Section"
    >
      <FontAwesome name="times-circle" />
    </Button>
  );
};