package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.address.model.task.ReadOnlyTask;

public class PersonCard extends UiPart<Region> {

    private static final String FXML = "PersonListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label id;
    @FXML
    private Label phone;
    @FXML
    private Label email;
//    @FXML
//    private Label endDate;
    @FXML
    private FlowPane tags;

    public PersonCard(ReadOnlyTask person, int displayedIndex) {
        super(FXML);
        name.setText(person.getDescription().description);
        id.setText(displayedIndex + ". ");
        phone.setText(person.getPriority().value);
        email.setText(person.getStartDate().value);
//        endDate.setText(person.getEndDate().value);
        initTags(person);
    }

    private void initTags(ReadOnlyTask person) {
        person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
    }
}

@@ -799,32 +799,44 @@
   phone.setText(
+%22Priority:%22+
 person.getPriori
@@ -840,32 +840,32 @@
 ority().value);%0A
-
         email.se
@@ -1032,24 +1032,26 @@
 k person) %7B%0A
+//
         pers
@@ -1127,16 +1127,433 @@
 ame)));%0A
+    %09%0A        person.getTags().forEach(tag -%3E %7B%0A        %09String complete = %22complete%22;%0A        %09System.out.println(tag.tagName);%0A        %09Label label1 = new Label(tag.tagName);%0A        %09//cannot use == to do string comparison%0A        %09if(tag.tagName.equals(complete))%7B%0A        %09%09label1.setStyle(%22-fx-border-color:pink; -fx-background-color:green;%22);%0A        %09%7D%0A        %09tags.getChildren().add(label1);   %0A        %7D);%0A
     %7D%0A%7D%0A

add priorty description, add color to complete tags