+
+
+ {translate("board.labels", "Etiquetas")}
+
+
+
+
+ {/* Lista de etiquetas */}
+
+ {boardLabels!.map((label) => {
+ const isAssigned = task.labels?.some(
+ (l) => l.label.id === label.id,
+ );
+ const contrastColor = getContrastColor(label.color);
+
+ return (
+
{
+ if (isAssigned && task.id && label.id) {
+ removeLabelAction(
+ task.id.toString(),
+ label.id.toString(),
+ );
+ } else if (task.id && label.id) {
+ addLabelAction(
+ task.id.toString(),
+ label.id.toString(),
+ );
+ }
+ }}
+ className={`flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm font-medium transition-colors duration-150 ${
+ isAssigned
+ ? "ring-accent ring-1"
+ : "hover:bg-background-hover-column"
+ }`}
+ style={{
+ backgroundColor: isAssigned ? label.color : "",
+ color: isAssigned ? contrastColor : "inherit",
+ }}
+ >
+
+
+ {label.name}
+
+
+
+ {isAssigned && (
+
+ )}
+
+ );
+ })}
+
+
+ {/* Crear nueva etiqueta */}
+
+
+
+
+ )}