feat: migration table schedule,dashboard,contest,curated content, communication,blog
This commit is contained in:
parent
73cc425d6a
commit
0e71cebb36
|
|
@ -3,7 +3,7 @@ import { Card, CardContent } from "@/components/ui/card";
|
||||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { UploadIcon } from "lucide-react";
|
import { UploadIcon } from "lucide-react";
|
||||||
import BlogTable from "./table-blog/mediahub-table";
|
import BlogTable from "./table-blog/blog-table";
|
||||||
|
|
||||||
const BlogPage = async () => {
|
const BlogPage = async () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,295 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
UploadIcon,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
commentFromUserName: string;
|
||||||
|
type: string;
|
||||||
|
date: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Pertanyaan",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "commentFromUserName",
|
||||||
|
header: "Pengirim ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">
|
||||||
|
{row.getValue("commentFromUserName")}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "type",
|
||||||
|
header: "Channel",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("type")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "date",
|
||||||
|
header: "Waktu ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("date")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const CollaborationTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div className="flex flex-row items-center gap-3">
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Kolaborasi Baru
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CollaborationTable;
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
commentFromUserName: "usertest-spv",
|
||||||
|
type: "Konten Media Hub",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
status: "Open",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
commentFromUserName: "usertest-journalist",
|
||||||
|
type: "Konten Media Hub",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
status: "Open",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
commentFromUserName: "usertest-spv",
|
||||||
|
type: "Konten Media Hub",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
status: "Open",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
commentFromUserName: "usertest-journalist",
|
||||||
|
type: "Konten Media Hub",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
status: "Open",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,288 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
UploadIcon,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
commentFromUserName: string;
|
||||||
|
type: string;
|
||||||
|
date: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Pertanyaan",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "commentFromUserName",
|
||||||
|
header: "Pengirim ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">
|
||||||
|
{row.getValue("commentFromUserName")}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "type",
|
||||||
|
header: "Channel",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("type")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "date",
|
||||||
|
header: "Waktu ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("date")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const EscalationTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EscalationTable;
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
createBy: "usertest-spv",
|
||||||
|
sendTo: "Mabes Polri - approver",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Pertanyaan Terkait Jadwal",
|
||||||
|
createBy: "usertest-spv",
|
||||||
|
sendTo: "Mabes Polri - approver",
|
||||||
|
date: "15/10/2024 9:11",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,281 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
UploadIcon,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
createBy: string;
|
||||||
|
sendTo: string;
|
||||||
|
date: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Pertanyaan",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "createBy",
|
||||||
|
header: "Pengirim ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("createBy")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "sendTo",
|
||||||
|
header: "Penerima",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("sendTo")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "date",
|
||||||
|
header: "Waktu ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("date")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const InternalTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div className="flex flex-row items-center gap-3">
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Pertanyaan Baru
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default InternalTable;
|
||||||
|
|
@ -1,5 +1,78 @@
|
||||||
|
import { StatisticsBlock } from "@/components/blocks/statistics-block";
|
||||||
|
import DashboardDropdown from "@/components/dashboard-dropdown";
|
||||||
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
|
import InternalTable from "./internal/table-internal/internal-table";
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import EscalationTable from "./escalation/table-escalation/escalation-table";
|
||||||
|
import CollaborationTable from "./collaboration/table-collaboration/collabroation-table";
|
||||||
|
|
||||||
const CommunicationPage = async () => {
|
const CommunicationPage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="my-3">
|
||||||
|
<Tabs defaultValue="internal" className="w-full">
|
||||||
|
<Card className="py-3 px-2 my-4">
|
||||||
|
<p className="text-lg font-semibold ml-2">Komunikasi</p>
|
||||||
|
<TabsList className="flex-wrap">
|
||||||
|
<TabsTrigger
|
||||||
|
value="internal"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Pertanyaan Internal
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="escalation"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Eskalasi
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="collaboration"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Kolaborasi
|
||||||
|
</TabsTrigger>
|
||||||
|
</TabsList>
|
||||||
|
</Card>
|
||||||
|
<TabsContent value="internal">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<InternalTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="escalation">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<EscalationTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="collaboration">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<CollaborationTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CommunicationPage;
|
export default CommunicationPage;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,30 @@
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import { UploadIcon } from "lucide-react";
|
||||||
|
import PressReleaseTable from "../schedule/press-conference/table-presscon/presscon-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import ContestTable from "./table-contest/contest-table";
|
||||||
|
|
||||||
const ContestPage = async () => {
|
const ContestPage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="space-y-4">
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Table Lomba
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<ContestTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ContestPage;
|
export default ContestPage;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,303 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
code: string;
|
||||||
|
title: string;
|
||||||
|
duration: string;
|
||||||
|
targetOutput: string;
|
||||||
|
targetParticipant: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "code",
|
||||||
|
header: "Kode",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4
|
||||||
|
className="text-sm font-bold
|
||||||
|
text-default-600 whitespace-nowrap mb-1"
|
||||||
|
>
|
||||||
|
{row.getValue("code")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Judul",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "duration",
|
||||||
|
header: "Durasi ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("duration")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "targetOutput",
|
||||||
|
header: "Tanggal Unggah ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("targetOutput")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "targetParticipant",
|
||||||
|
header: "Tag ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">
|
||||||
|
{row.getValue("targetParticipant")}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const ContestTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ContestTable;
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
code: "#NEWLOMBA",
|
||||||
|
duration: "2023-08-31 07:00:00 - 2023-09-01 07:00:00",
|
||||||
|
targetOutput: "Foto",
|
||||||
|
targetParticipant: "Polda, mabes",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -1,5 +1,113 @@
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
|
import InternalTable from "../communication/internal/table-internal/internal-table";
|
||||||
|
import EscalationTable from "../communication/escalation/table-escalation/escalation-table";
|
||||||
|
import CollaborationTable from "../communication/collaboration/table-collaboration/collabroation-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Search, UploadIcon } from "lucide-react";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
|
||||||
const CuratedContentPage = async () => {
|
const CuratedContentPage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="my-3">
|
||||||
|
<Tabs defaultValue="giat-routine" className="w-full">
|
||||||
|
<Card className="py-3 px-2 my-4">
|
||||||
|
<p className="text-lg font-semibold ml-2">Kurasi Konten</p>
|
||||||
|
<TabsList className="flex-wrap">
|
||||||
|
<TabsTrigger
|
||||||
|
value="giat-routine"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Giat Rutin
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="giat-penugasan"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Giat Penugasan
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="contest"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Lomba
|
||||||
|
</TabsTrigger>
|
||||||
|
</TabsList>
|
||||||
|
</Card>
|
||||||
|
<TabsContent value="giat-routine">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="giat-penugasan">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="contest">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CuratedContentPage;
|
export default CuratedContentPage;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,15 +0,0 @@
|
||||||
import { Metadata } from "next";
|
|
||||||
|
|
||||||
export const metadata:Metadata={
|
|
||||||
title: 'Dashboard',
|
|
||||||
description: 'Dashboard Description'
|
|
||||||
}
|
|
||||||
const Layout = ({children}: {children: React.ReactNode}) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{children}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Layout;
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
import Image from "next/image";
|
|
||||||
import { StatisticsBlock } from "@/components/blocks/statistics-block";
|
|
||||||
import { BlockBadge, WelcomeBlock } from "@/components/blocks/welcome-block";
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
||||||
import RevinueBarChart from "@/components/revenue-bar-chart";
|
|
||||||
import DashboardDropdown from "@/components/dashboard-dropdown";
|
|
||||||
import OverviewChart from "./components/overview-chart";
|
|
||||||
import CompanyTable from "./components/company-table";
|
|
||||||
import RecentActivity from "./components/recent-activity";
|
|
||||||
import MostSales from "./components/most-sales";
|
|
||||||
import OverviewRadialChart from "./components/overview-radial";
|
|
||||||
import { useTranslations } from "next-intl";
|
|
||||||
const DashboardPage = () => {
|
|
||||||
const t = useTranslations("AnalyticsDashboard");
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className="grid grid-cols-12 items-center gap-5 mb-5">
|
|
||||||
<div className="2xl:col-span-12 lg:col-span-12 col-span-12">
|
|
||||||
<Card>
|
|
||||||
<CardContent className="p-4">
|
|
||||||
<div className="grid md:grid-cols-3 gap-4">
|
|
||||||
<StatisticsBlock
|
|
||||||
title={"Hasil unggah disetujui hari ini"}
|
|
||||||
total="3,564"
|
|
||||||
className="bg-info/10 border-none shadow-none"
|
|
||||||
/>
|
|
||||||
<StatisticsBlock
|
|
||||||
title={"Hasil unggah direvisi hari ini"}
|
|
||||||
total="564"
|
|
||||||
className="bg-warning/10 border-none shadow-none"
|
|
||||||
chartColor="#FB8F65"
|
|
||||||
/>
|
|
||||||
<StatisticsBlock
|
|
||||||
title={"Hasil unggah ditolak hari ini"}
|
|
||||||
total="+5.0%"
|
|
||||||
className="bg-primary/10 border-none shadow-none"
|
|
||||||
chartColor="#2563eb"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="grid grid-cols-12 gap-5">
|
|
||||||
<div className="lg:col-span-4 col-span-12">
|
|
||||||
<Card>
|
|
||||||
<CardHeader className="flex flex-row items-center">
|
|
||||||
<CardTitle className="flex-1 text-lg">
|
|
||||||
{"Total Produksi Konten"}
|
|
||||||
</CardTitle>
|
|
||||||
<DashboardDropdown />
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<RecentActivity />
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
<div className="lg:col-span-8 col-span-12">
|
|
||||||
<Card>
|
|
||||||
<CardHeader className="flex flex-row items-center">
|
|
||||||
<CardTitle className="flex-1">{"Table"}</CardTitle>
|
|
||||||
<DashboardDropdown />
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="p-0">
|
|
||||||
<CompanyTable />
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DashboardPage;
|
|
||||||
|
|
@ -0,0 +1,168 @@
|
||||||
|
import { StatisticsBlock } from "@/components/blocks/statistics-block";
|
||||||
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
|
import DashboardDropdown from "@/components/dashboard-dropdown";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { UploadIcon } from "lucide-react";
|
||||||
|
import RecentActivity from "./routine-task/recent-activity";
|
||||||
|
import CompanyTable from "./routine-task/routine-task-table";
|
||||||
|
import TaskTable from "../task/table-task/task-table";
|
||||||
|
import PressConferenceTable from "../schedule/press-release/table-persrilis/pressrilis-table";
|
||||||
|
import BlogTable from "../blog/table-blog/blog-table";
|
||||||
|
|
||||||
|
const DashboardPage = () => {
|
||||||
|
const t = useTranslations("AnalyticsDashboard");
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div className="my-3">
|
||||||
|
<Tabs defaultValue="routine-task" className="w-full">
|
||||||
|
<Card className="py-3 px-2 my-4">
|
||||||
|
<TabsList className="flex-wrap">
|
||||||
|
<TabsTrigger
|
||||||
|
value="routine-task"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Tugas Rutin
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="task"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Penugasan
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="schedule"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Jadwal
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger
|
||||||
|
value="indeks"
|
||||||
|
className="data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-md px-6"
|
||||||
|
>
|
||||||
|
Indeks
|
||||||
|
</TabsTrigger>
|
||||||
|
</TabsList>
|
||||||
|
</Card>
|
||||||
|
<TabsContent value="routine-task">
|
||||||
|
<div className="grid grid-cols-12 items-center gap-5 mb-5">
|
||||||
|
<div className="2xl:col-span-12 lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-4">
|
||||||
|
<div className="grid md:grid-cols-3 gap-4">
|
||||||
|
<StatisticsBlock
|
||||||
|
title={"Hasil unggah disetujui hari ini"}
|
||||||
|
total="3,564"
|
||||||
|
className="bg-info/10 border-none shadow-none"
|
||||||
|
/>
|
||||||
|
<StatisticsBlock
|
||||||
|
title={"Hasil unggah direvisi hari ini"}
|
||||||
|
total="564"
|
||||||
|
className="bg-warning/10 border-none shadow-none"
|
||||||
|
chartColor="#FB8F65"
|
||||||
|
/>
|
||||||
|
<StatisticsBlock
|
||||||
|
title={"Hasil unggah ditolak hari ini"}
|
||||||
|
total="+5.0%"
|
||||||
|
className="bg-primary/10 border-none shadow-none"
|
||||||
|
chartColor="#2563eb"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-4 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="flex flex-row items-center">
|
||||||
|
<CardTitle className="flex-1 text-lg">
|
||||||
|
{"Total Produksi Konten"}
|
||||||
|
</CardTitle>
|
||||||
|
<DashboardDropdown />
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<RecentActivity />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div className="lg:col-span-8 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardHeader className="flex flex-row items-center">
|
||||||
|
<CardTitle className="flex-1">{"Table"}</CardTitle>
|
||||||
|
<DashboardDropdown />
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<CompanyTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="task">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Table Penugasan
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Buat Penugasan
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<TaskTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="schedule">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<PressConferenceTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
<TabsContent value="indeks">
|
||||||
|
<div className="grid grid-cols-12 gap-5">
|
||||||
|
<div className="lg:col-span-12 col-span-12">
|
||||||
|
<Card>
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Table Indeks
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Tambah Indeks
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<BlogTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TabsContent>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DashboardPage;
|
||||||
|
|
@ -1,5 +1,36 @@
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import { UploadIcon } from "lucide-react";
|
||||||
|
import PressConferenceTable from "../press-conference/table-presscon/presscon-table";
|
||||||
|
import EventTable from "./table-event/event-table";
|
||||||
|
|
||||||
const EventPage = async () => {
|
const EventPage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="space-y-4">
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Jadwal Event
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Buat Jadwal
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<EventTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EventPage;
|
export default EventPage;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,308 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
time: string;
|
||||||
|
loccation: string;
|
||||||
|
speakerName: string;
|
||||||
|
uploaderName: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Judul",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "startDate",
|
||||||
|
header: "Tanggal Mulai ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("startDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "endDate",
|
||||||
|
header: "Tanggal Selesai",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("endDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "time",
|
||||||
|
header: "Waktu",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "loccation",
|
||||||
|
header: "Lokasi",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "speakerName",
|
||||||
|
header: "Disampaikan oleh",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("speakerName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "uploaderName",
|
||||||
|
header: "Sumber ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const EventTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EventTable;
|
||||||
|
|
@ -1,5 +1,35 @@
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import PressConferenceTable from "./table-presscon/presscon-table";
|
||||||
|
import { UploadIcon } from "lucide-react";
|
||||||
|
|
||||||
const PressConferencePage = async () => {
|
const PressConferencePage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="space-y-4">
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Jadwal Konferensi Pers
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Buat Jadwal
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<PressConferenceTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PressConferencePage;
|
export default PressConferencePage;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,308 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
time: string;
|
||||||
|
loccation: string;
|
||||||
|
speakerName: string;
|
||||||
|
uploaderName: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Judul",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "startDate",
|
||||||
|
header: "Tanggal Mulai ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("startDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "endDate",
|
||||||
|
header: "Tanggal Selesai",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("endDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "time",
|
||||||
|
header: "Waktu",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "loccation",
|
||||||
|
header: "Lokasi",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "speakerName",
|
||||||
|
header: "Disampaikan oleh",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("speakerName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "uploaderName",
|
||||||
|
header: "Sumber ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const PressReleaseTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PressReleaseTable;
|
||||||
|
|
@ -1,5 +1,35 @@
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
|
import { UploadIcon } from "lucide-react";
|
||||||
|
import PressReleaseTable from "../press-conference/table-presscon/presscon-table";
|
||||||
|
|
||||||
const PressReleasePage = async () => {
|
const PressReleasePage = async () => {
|
||||||
return <div></div>;
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="space-y-4">
|
||||||
|
<Card className="py-4 px-3">
|
||||||
|
<div className="flex flex-row justify-between items-center">
|
||||||
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
|
Jadwal Pers Rilis
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button color="primary" className="text-white">
|
||||||
|
<UploadIcon />
|
||||||
|
Buat Jadwal
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<CardContent className="p-0">
|
||||||
|
<PressReleaseTable />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PressReleasePage;
|
export default PressReleasePage;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
export const data = [
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Ops Mantap Praja & Pilkada 2024",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Seputar Prestasi",
|
||||||
|
startDate: "12/10/2024",
|
||||||
|
endDate: "15/10/2024",
|
||||||
|
time: "10:00",
|
||||||
|
loccation:
|
||||||
|
"2, Jl. Trunojoyo No.3, RT.2/RW.1, Selong, Kec. Kby. Baru, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12110, Indonesia",
|
||||||
|
speakerName: "Tn anang",
|
||||||
|
uploaderName: "Mabes Polri - Approver",
|
||||||
|
status: "Terkirim",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,308 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
Badge,
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
|
export type CompanyData = {
|
||||||
|
title: string;
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
time: string;
|
||||||
|
loccation: string;
|
||||||
|
speakerName: string;
|
||||||
|
uploaderName: string;
|
||||||
|
status: string;
|
||||||
|
};
|
||||||
|
import { data } from "./data";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
|
||||||
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "title",
|
||||||
|
header: "Judul",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("title")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "startDate",
|
||||||
|
header: "Tanggal Mulai ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("startDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "endDate",
|
||||||
|
header: "Tanggal Selesai",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("endDate")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "time",
|
||||||
|
header: "Waktu",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "loccation",
|
||||||
|
header: "Lokasi",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "speakerName",
|
||||||
|
header: "Disampaikan oleh",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("speakerName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "uploaderName",
|
||||||
|
header: "Sumber ",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<Eye className="w-4 h-4 me-1.5" />
|
||||||
|
View
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none">
|
||||||
|
<SquarePen className="w-4 h-4 me-1.5" />
|
||||||
|
Edit
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none">
|
||||||
|
<Trash2 className="w-4 h-4 me-1.5" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const PressConferenceTable = () => {
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 6,
|
||||||
|
});
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto">
|
||||||
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
<div>
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
<div className="flex-none">
|
||||||
|
<Input
|
||||||
|
placeholder="Filter Status..."
|
||||||
|
value={
|
||||||
|
(table.getColumn("status")?.getFilterValue() as string) ?? ""
|
||||||
|
}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
|
table.getColumn("status")?.setFilterValue(event.target.value)
|
||||||
|
}
|
||||||
|
className="max-w-sm "
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<div className="flex items-center justify-center py-4 gap-2 flex-none">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.previousPage()}
|
||||||
|
disabled={!table.getCanPreviousPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronLeft className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
{table.getPageOptions().map((page, pageIndex) => (
|
||||||
|
<Button
|
||||||
|
key={`basic-data-table-${pageIndex}`}
|
||||||
|
onClick={() => table.setPageIndex(pageIndex)}
|
||||||
|
size="icon"
|
||||||
|
className="w-8 h-8"
|
||||||
|
variant={
|
||||||
|
table.getState().pagination.pageIndex === pageIndex
|
||||||
|
? "default"
|
||||||
|
: "outline"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{page + 1}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => table.nextPage()}
|
||||||
|
disabled={!table.getCanNextPage()}
|
||||||
|
className="w-8 h-8"
|
||||||
|
>
|
||||||
|
<ChevronRight className="w-4 h-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PressConferenceTable;
|
||||||
|
|
@ -14,12 +14,6 @@ const TaskPage = async () => {
|
||||||
<div className="flex-1 text-xl font-medium text-default-900">
|
<div className="flex-1 text-xl font-medium text-default-900">
|
||||||
Table Penugasan
|
Table Penugasan
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<Button color="primary" className="text-white">
|
|
||||||
<UploadIcon />
|
|
||||||
Buat Penugasan
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card>
|
<Card>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Inter } from "next/font/google";
|
import { Inter } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import "./theme.css"
|
import "./theme.css";
|
||||||
import { ThemeProvider } from "@/providers/theme-provider";
|
import { ThemeProvider } from "@/providers/theme-provider";
|
||||||
import MountedProvider from "@/providers/mounted.provider";
|
import MountedProvider from "@/providers/mounted.provider";
|
||||||
import { Toaster } from '@/components/ui/toaster'
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
import { Toaster as SonnerToaster } from "@/components/ui/sonner"
|
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
// language
|
// language
|
||||||
import { getLangDir } from 'rtl-detect';
|
import { getLangDir } from "rtl-detect";
|
||||||
import { NextIntlClientProvider } from 'next-intl';
|
import { NextIntlClientProvider } from "next-intl";
|
||||||
import { getMessages } from 'next-intl/server';
|
import { getMessages } from "next-intl/server";
|
||||||
import DirectionProvider from "@/providers/direction-provider";
|
import DirectionProvider from "@/providers/direction-provider";
|
||||||
import AuthProvider from "@/providers/auth.provider";
|
import AuthProvider from "@/providers/auth.provider";
|
||||||
|
|
||||||
|
|
@ -26,7 +26,6 @@ export default async function RootLayout({
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
params: { locale: string };
|
params: { locale: string };
|
||||||
}>) {
|
}>) {
|
||||||
|
|
||||||
const messages = await getMessages();
|
const messages = await getMessages();
|
||||||
const direction = getLangDir(locale);
|
const direction = getLangDir(locale);
|
||||||
return (
|
return (
|
||||||
|
|
@ -34,15 +33,11 @@ export default async function RootLayout({
|
||||||
<body className={`${inter.className} dashcode-app`}>
|
<body className={`${inter.className} dashcode-app`}>
|
||||||
<NextIntlClientProvider messages={messages} locale={locale}>
|
<NextIntlClientProvider messages={messages} locale={locale}>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<ThemeProvider attribute="class"
|
<ThemeProvider attribute="class" defaultTheme="light">
|
||||||
|
|
||||||
defaultTheme="light">
|
|
||||||
<MountedProvider>
|
<MountedProvider>
|
||||||
|
|
||||||
<DirectionProvider direction={direction}>
|
<DirectionProvider direction={direction}>
|
||||||
{children}
|
{children}
|
||||||
</DirectionProvider>
|
</DirectionProvider>
|
||||||
|
|
||||||
</MountedProvider>
|
</MountedProvider>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<SonnerToaster />
|
<SonnerToaster />
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
"use client";
|
"use client";
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Link } from '@/i18n/routing';
|
import { Link } from "@/i18n/routing";
|
||||||
import { Icon } from "@/components/ui/icon";
|
import { Icon } from "@/components/ui/icon";
|
||||||
import { useForm, SubmitHandler } from "react-hook-form";
|
import { useForm, SubmitHandler } from "react-hook-form";
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils";
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from "lucide-react";
|
||||||
import { loginUser } from '@/action/auth-action';
|
import { loginUser } from "@/action/auth-action";
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner";
|
||||||
import { useRouter } from '@/components/navigation';
|
import { useRouter } from "@/components/navigation";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
email: z.string().email({ message: "Your email is invalid." }),
|
email: z.string().email({ message: "Your email is invalid." }),
|
||||||
|
|
@ -24,7 +24,6 @@ const LoginForm = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [passwordType, setPasswordType] = React.useState("password");
|
const [passwordType, setPasswordType] = React.useState("password");
|
||||||
|
|
||||||
|
|
||||||
const togglePasswordType = () => {
|
const togglePasswordType = () => {
|
||||||
if (passwordType === "text") {
|
if (passwordType === "text") {
|
||||||
setPasswordType("password");
|
setPasswordType("password");
|
||||||
|
|
@ -57,10 +56,9 @@ const LoginForm = () => {
|
||||||
if (!!response.error) {
|
if (!!response.error) {
|
||||||
toast("Event has been created", {
|
toast("Event has been created", {
|
||||||
description: "Sunday, December 03, 2023 at 9:00 AM",
|
description: "Sunday, December 03, 2023 at 9:00 AM",
|
||||||
|
});
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
router.push('/dashboard/analytics');
|
router.push("/dashboard");
|
||||||
toast.success("Successfully logged in");
|
toast.success("Successfully logged in");
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|
@ -75,7 +73,8 @@ const LoginForm = () => {
|
||||||
<Label htmlFor="email" className=" font-medium text-default-600">
|
<Label htmlFor="email" className=" font-medium text-default-600">
|
||||||
Email{" "}
|
Email{" "}
|
||||||
</Label>
|
</Label>
|
||||||
<Input size="lg"
|
<Input
|
||||||
|
size="lg"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
{...register("email")}
|
{...register("email")}
|
||||||
type="email"
|
type="email"
|
||||||
|
|
@ -96,7 +95,8 @@ const LoginForm = () => {
|
||||||
Password{" "}
|
Password{" "}
|
||||||
</Label>
|
</Label>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<Input size="lg"
|
<Input
|
||||||
|
size="lg"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
{...register("password")}
|
{...register("password")}
|
||||||
type={passwordType}
|
type={passwordType}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
menus: [
|
menus: [
|
||||||
{
|
{
|
||||||
id: "dashboard",
|
id: "dashboard",
|
||||||
href: "/dashboard/analytics",
|
href: "/dashboard/tabs",
|
||||||
label: t("dashboard"),
|
label: t("dashboard"),
|
||||||
active: pathname.includes("/dashboard"),
|
active: pathname.includes("/dashboard"),
|
||||||
icon: "material-symbols:dashboard",
|
icon: "material-symbols:dashboard",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue