package seedu.geekeep.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.geekeep.model.task.ReadOnlyTask;

public class TaskCard 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 address;
    @FXML
    private Label email;
    @FXML
    private FlowPane tags;

    public TaskCard(ReadOnlyTask person, int displayedIndex) {
        super(FXML);
        name.setText(person.getTitle().fullTitle);
        id.setText(displayedIndex + ". ");
        phone.setText(person.getEndDateTime().value);
        address.setText(person.getLocation().value);
        email.setText(person.getStartDateTime().value);
        initTags(person);
    }

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

@@ -745,16 +745,22 @@
 setText(
+%22#%22 + 
 displaye
@@ -773,176 +773,561 @@
  + %22
-. %22);%0A        phone.setText(person.getEndDateTime().value);%0A        address.setText(person.getLocation().value);%0A        email.setText(person.getStartDateTime().value);
+ %22);%0A%0A        if (person.getEndDateTime() != null && person.getStartDateTime() != null) %7B%0A            phone.setText(person.getStartDateTime() + %22 until %22 + person.getEndDateTime());%0A        %7D else if (person.getEndDateTime() != null && person.getStartDateTime() == null) %7B%0A            phone.setText(person.getEndDateTime().value);%0A        %7D else %7B%0A            phone.setText(null);%0A        %7D%0A%0A        if (person.getLocation() == null) %7B%0A            address.setText(%22%22);%0A        %7D else %7B%0A            address.setText(person.getLocation().value);%0A        %7D%0A
 %0A   

Update display of task card