<?php

namespace App\Http\Controllers\Frontend;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;


class TodoController extends Controller
{
    public function AssignedListIndex()
    {
        return view('frontend.todo.assigned-list');
    }

    public function getAssignedList(Request $request)
    {
        $row = [
            [
                'counter' => 1,
                'created_at' => getDateWithIcon(date('y-m-d')),
                'title' => 'Design System Update',
                'label' => '<span class="badge rounded-pill text-bg-primary me-1">Development</span>
                            <span class="badge rounded-pill text-bg-info me-1">Marketing</span>',
                'description' => 'Update the design system with new color palette and typography guidelines',
                'due_date' => getDateWithIcon(date('y-m-d',strtotime('+1 day'))),
                'count_of_assignees' => 3,
            ],
            [
                'counter' => 2,
                'created_at' => getDateWithIcon(date('y-m-d')),
                'title' => 'API Integration',
                'label' => '<span class="badge rounded-pill text-bg-primary me-1">Development</span>',
                'description' => 'Integrate the new payment API endpoints with the frontend',
                'due_date' => getDateWithIcon(date('y-m-d',strtotime('+4 day'))),
                'count_of_assignees' => 5,
            ],
            [
                'counter' => 3,
                'created_at' => getDateWithIcon(date('y-m-d')),
                'title' => 'Set Up 2FA',
                'label' => '<span class="badge rounded-pill text-bg-danger me-1">Security</span>',
                'description' => 'Setup your two factor authentication',
                'due_date' => getDateWithIcon(date('y-m-d',strtotime('+2 day'))),
                'count_of_assignees' => 50,
            ],
            [
                'counter' => 4,
                'created_at' => getDateWithIcon(date('y-m-d')),
                'title' => 'Design System Update',
                'label' => '<span class="badge rounded-pill text-bg-primary me-1">Development</span>
                            <span class="badge rounded-pill text-bg-info me-1">Marketing</span>
                            <span class="badge rounded-pill text-bg-danger me-1">Security</span>',
                'description' => 'Update the design system with new color palette and typography guidelines',
                'due_date' => getDateWithIcon(date('y-m-d',strtotime('+1 day'))),
                'count_of_assignees' => 3,
            ]
        ];

        $count = count($row);

        return [
            'items' => $row,
            'count' => $count,
        ];
    }
}
