2024-12-06 18:37:45 +00:00
|
|
|
"use client";
|
2024-12-11 18:28:57 +00:00
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
|
import TaskTable from "./components/task-table";
|
2024-11-29 12:41:23 +00:00
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { UploadIcon } from "lucide-react";
|
|
|
|
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
2024-12-03 17:49:25 +00:00
|
|
|
import { Link } from "@/components/navigation";
|
2024-12-06 18:37:45 +00:00
|
|
|
import { checkAuthorization, checkLoginSession } from "@/lib/utils";
|
|
|
|
|
import React, { useEffect } from "react";
|
2025-02-22 10:34:27 +00:00
|
|
|
import { useTranslations } from "next-intl";
|
2024-12-06 18:37:45 +00:00
|
|
|
|
|
|
|
|
const TaskPage = () => {
|
2025-02-22 10:34:27 +00:00
|
|
|
const t = useTranslations("AnalyticsDashboard");
|
2024-12-06 18:37:45 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
function initState() {
|
2025-08-01 08:19:58 +00:00
|
|
|
checkAuthorization("admin");
|
2024-12-06 18:37:45 +00:00
|
|
|
checkLoginSession();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initState();
|
|
|
|
|
}, []);
|
2024-11-29 12:41:23 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<SiteBreadcrumb />
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
<Card>
|
2024-12-11 18:28:57 +00:00
|
|
|
<CardHeader className="border-b border-solid border-default-200 mb-6">
|
|
|
|
|
<CardTitle>
|
2025-01-31 14:16:41 +00:00
|
|
|
<div className="flex flex-col sm:flex-row lg:flex-row lg:items-center">
|
2024-12-11 18:28:57 +00:00
|
|
|
<div className="flex-1 text-xl font-medium text-default-900">
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("tabel", { defaultValue: "Tabel" })} {t("task", { defaultValue: "Task" })}
|
2024-12-11 18:28:57 +00:00
|
|
|
</div>
|
|
|
|
|
<div className="flex-none">
|
2024-12-13 00:39:20 +00:00
|
|
|
<Link href={"/contributor/task/create"}>
|
2024-12-11 18:28:57 +00:00
|
|
|
<Button color="primary" className="text-white">
|
2025-04-09 12:19:36 +00:00
|
|
|
<UploadIcon size={18} className="mr-2" />
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("create-task", { defaultValue: "Create Task" })}
|
2024-12-11 18:28:57 +00:00
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CardTitle>
|
|
|
|
|
</CardHeader>
|
2024-11-29 12:41:23 +00:00
|
|
|
<CardContent className="p-0">
|
|
|
|
|
<TaskTable />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-11-27 04:14:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TaskPage;
|