import { Archive, Pencil, Trash2 } from "lucide-react";
import { Button } from "./primitives";

export function ItemActions({ name, kind, disabled, onEdit, onDelete }: {
  name: string;
  kind: "habit" | "task";
  disabled?: boolean;
  onEdit: () => void;
  onDelete: () => void;
}) {
  return (
    <span className="ds-item-actions" role="group" aria-label={`${name} actions`}>
      <Button variant="text" className="ds-icon-button" disabled={disabled} onClick={onEdit} aria-label={`Edit ${kind} ${name}`} title={`Edit ${kind}`}>
        <Pencil size={16} aria-hidden="true" />
      </Button>
      <Button variant="text" className="ds-icon-button" disabled={disabled} onClick={onDelete} aria-label={`${kind === "habit" ? "Archive" : "Delete"} ${kind} ${name}`} title={`${kind === "habit" ? "Archive" : "Delete"} ${kind}`}>
        {kind === "habit" ? <Archive size={16} aria-hidden="true" /> : <Trash2 size={16} aria-hidden="true" />}
      </Button>
    </span>
  );
}
