import { List } from "antd";
import React from "react";
import { DeleteFilled } from "@ant-design/icons";
import ipcTypes from "../../../ipc.types";
const { ipcRenderer } = window;

export default function FilePathMolecule(item, index) {
  const handleClick = () => {
    ipcRenderer.send(ipcTypes.fileWatcher.toMain.removePath, item);
  };

  return (
    <List.Item key={index} actions={[<DeleteFilled onClick={handleClick} />]}>
      {item}
    </List.Item>
  );
}
