import React from "react";
import Delete from "../assets/Delete";
import DeleteButton from "./DeleteButton";
import StyledChip from "./StyledChip";

type ChipProps = {
  label: string;
  onDelete: () => void;
  props?: any;
};

const Chip: React.FC<ChipProps> = ({ label, onDelete, ...props }) => {
  return (
    <StyledChip {...props}>
      <span>{label}</span>
      <DeleteButton clickHandler={onDelete}>
        <Delete />
      </DeleteButton>
    </StyledChip>
  );
};

export default Chip;
