{"size": 1998, "ext": "js", "max_stars_repo_path": "src/components/AddTodoItem.js", "max_stars_repo_name": "ClintonEnyinna/todo_list", "max_stars_repo_stars_event_min_datetime": "2020-05-08T09:34:34.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-22T16:10:09.000Z", "max_issues_repo_path": "src/components/AddTodoItem.js", "max_issues_repo_name": "ClintonEnyinna/todo_list", "max_issues_repo_issues_event_min_datetime": "2021-03-10T17:46:15.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T13:36:36.000Z", "max_forks_repo_path": "src/components/AddTodoItem.js", "max_forks_repo_name": "ClintonEnyinna/todo_list", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 28.1408450704, "max_line_length": 68, "alphanum_fraction": 0.6871871872}
import { element, text } from './MakeElements';
import '../css/add_todo_item.css';

const addTodoForm = () => {
  const div = element('DIV');
  div.setAttribute('class', 'add-item');
  const form = element('FORM');
  const inputTitle = element('INPUT');
  inputTitle.setAttribute('placeholder', 'Title');
  inputTitle.setAttribute('type', 'text');

  const inputDate = element('INPUT');
  inputDate.setAttribute('placeholder', 'Due date');
  inputDate.setAttribute('type', 'text');
  inputDate.setAttribute('id', 'date');

  const parentDiv = element('DIV');
  parentDiv.setAttribute('class', 'priority');
  const h6 = element('H6');
  const h6Txt = text('Priority');
  h6.append(h6Txt);

  const priorityDiv = element('DIV');
  const highLabel = element('LABEL');
  highLabel.innerText = 'High';
  const lowLabel = element('LABEL');
  lowLabel.innerText = 'Low';
  const mediumlabel = element('LABEL');
  mediumlabel.innerText = 'Medium';

  const highCheck = element('INPUT');
  highCheck.setAttribute('type', 'radio');
  highCheck.setAttribute('value', 'high');
  highCheck.setAttribute('name', 'priority');

  const mediumCheck = element('INPUT');
  mediumCheck.setAttribute('type', 'radio');
  mediumCheck.setAttribute('value', 'medium');
  mediumCheck.setAttribute('name', 'priority');

  const lowCheck = element('INPUT');
  lowCheck.setAttribute('type', 'radio');
  lowCheck.setAttribute('value', 'low');
  lowCheck.setAttribute('name', 'priority');

  priorityDiv.append(
    highLabel,
    highCheck,
    mediumlabel,
    mediumCheck,
    lowLabel,
    lowCheck,
  );

  parentDiv.append(h6, priorityDiv);
  const inputDesc = element('TEXTAREA');
  inputDesc.setAttribute('placeholder', 'Description');
  inputDesc.setAttribute('id', 'todoItemDesc');

  const saveBtn = element('BUTTON');
  saveBtn.innerText = 'Create';

  form.append(inputTitle, inputDate, parentDiv, inputDesc, saveBtn);
  div.append(form);
  div.style.display = 'none';

  return div;
};

export default addTodoForm;
