From 73cc425d6a967d0d7736ee9e276c9161c7c06dfe Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Fri, 29 Nov 2024 19:41:23 +0700 Subject: [PATCH] feat:add table penugasan,perencanaan,indeks,agenda setting --- .../agenda-setting/calender-view.tsx | 47 ++- .../(protected)/agenda-setting/data.ts | 85 ++--- app/[locale]/(protected)/blog/page.tsx | 33 +- .../(protected)/blog/table-blog/data.ts | 65 ++++ .../blog/table-blog/mediahub-table.tsx | 284 +++++++++++++++++ .../analytics/components/recent-activity.tsx | 8 +- .../(protected)/dashboard/analytics/page.tsx | 2 +- .../(protected)/planning/mediahub/page.tsx | 27 +- .../planning/mediahub/table-mediahub/data.ts | 47 +++ .../table-mediahub/mediahub-table.tsx | 268 ++++++++++++++++ .../planning/medsos-mediahub/page.tsx | 24 +- .../medsos-mediahub/table-medsos/data.ts | 47 +++ .../table-medsos/medsos-table.tsx | 268 ++++++++++++++++ app/[locale]/(protected)/task/page.tsx | 32 +- .../(protected)/task/table-task/data.ts | 106 +++++++ .../task/table-task/task-table.tsx | 298 ++++++++++++++++++ 16 files changed, 1553 insertions(+), 88 deletions(-) create mode 100644 app/[locale]/(protected)/blog/table-blog/data.ts create mode 100644 app/[locale]/(protected)/blog/table-blog/mediahub-table.tsx create mode 100644 app/[locale]/(protected)/planning/mediahub/table-mediahub/data.ts create mode 100644 app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx create mode 100644 app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/data.ts create mode 100644 app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/medsos-table.tsx create mode 100644 app/[locale]/(protected)/task/table-task/data.ts create mode 100644 app/[locale]/(protected)/task/table-task/task-table.tsx diff --git a/app/[locale]/(protected)/agenda-setting/calender-view.tsx b/app/[locale]/(protected)/agenda-setting/calender-view.tsx index 2f707e0f..6eba2619 100644 --- a/app/[locale]/(protected)/agenda-setting/calender-view.tsx +++ b/app/[locale]/(protected)/agenda-setting/calender-view.tsx @@ -12,26 +12,27 @@ import { Calendar } from "@/components/ui/calendar"; import { Card, CardContent, CardHeader } from "@/components/ui/card"; import { Plus } from "lucide-react"; import { Checkbox } from "@/components/ui/checkbox"; -import { CalendarEvent, CalendarCategory } from "./data" -import { - EventContentArg, -} from '@fullcalendar/core' +import { CalendarEvent, CalendarCategory } from "./data"; +import { EventContentArg } from "@fullcalendar/core"; import EventModal from "./event-modal"; import { useTranslations } from "next-intl"; const wait = () => new Promise((resolve) => setTimeout(resolve, 1000)); interface CalendarViewProps { events: CalendarEvent[]; categories: CalendarCategory[]; - - } const CalendarView = ({ events, categories }: CalendarViewProps) => { - const [selectedCategory, setSelectedCategory] = useState(null); + const [selectedCategory, setSelectedCategory] = useState( + null + ); const [selectedEventDate, setSelectedEventDate] = useState(null); - const [selectedEvent, setSelectedEvent] = useState(null); - const [draggableInitialized, setDraggableInitialized] = useState(false); -const t = useTranslations("CalendarApp") + const [selectedEvent, setSelectedEvent] = useState( + null + ); + const [draggableInitialized, setDraggableInitialized] = + useState(false); + const t = useTranslations("CalendarApp"); // event canvas state const [sheetOpen, setSheetOpen] = useState(false); const [date, setDate] = React.useState(new Date()); @@ -103,30 +104,22 @@ const t = useTranslations("CalendarApp") if (selectedCategory && selectedCategory.includes(category)) { setSelectedCategory(selectedCategory.filter((c) => c !== category)); } else { - setSelectedCategory([...selectedCategory || [], category]); + setSelectedCategory([...(selectedCategory || []), category]); } }; const handleClassName = (arg: EventContentArg) => { - - if (arg.event.extendedProps.calendar === "holiday") { + if (arg.event.extendedProps.calendar === "national") { return "destructive"; - } - else if (arg.event.extendedProps.calendar === "business") { + } else if (arg.event.extendedProps.calendar === "polda") { return "primary"; - } else if (arg.event.extendedProps.calendar === "personal") { + } else if (arg.event.extendedProps.calendar === "polres") { return "success"; - } else if (arg.event.extendedProps.calendar === "family") { + } else if (arg.event.extendedProps.calendar === "international") { return "info"; - } else if (arg.event.extendedProps.calendar === "etc") { - return "info"; - } else if (arg.event.extendedProps.calendar === "meeting") { - return "warning"; - } - else { + } else { return "primary"; } - }; const filteredEvents = events?.filter((event) => @@ -144,7 +137,7 @@ const t = useTranslations("CalendarApp") className="dark:bg-background dark:text-foreground" > - {t("addEvent")} + {"Tambahkan Agenda baru"}
@@ -160,14 +153,14 @@ const t = useTranslations("CalendarApp")

- {t("shortDesc")} + {t("shortDesc")}

{dragEvents.map((event) => ( ))}
- {t("filter")} + {t("filter")}
  • diff --git a/app/[locale]/(protected)/agenda-setting/data.ts b/app/[locale]/(protected)/agenda-setting/data.ts index 8f4716c9..16e94cee 100644 --- a/app/[locale]/(protected)/agenda-setting/data.ts +++ b/app/[locale]/(protected)/agenda-setting/data.ts @@ -10,14 +10,14 @@ const nextMonth = date.getMonth() === 11 ? new Date(date.getFullYear() + 1, 0, 1 const prevMonth = date.getMonth() === 11 ? new Date(date.getFullYear() - 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() - 1, 1) export const calendarEvents = [ { - id: faker.string.uuid() , + id: faker.string.uuid(), title: "All Day Event", start: date, end: nextDay, allDay: false, //className: "warning", extendedProps: { - calendar: "business", + calendar: "polda", }, }, { @@ -28,7 +28,7 @@ export const calendarEvents = [ allDay: true, //className: "success", extendedProps: { - calendar: "personal", + calendar: "national", }, }, { @@ -39,7 +39,7 @@ export const calendarEvents = [ end: new Date(date.getFullYear(), date.getMonth() + 1, -7), // className: "info", extendedProps: { - calendar: "family", + calendar: "polres", }, }, { @@ -50,7 +50,7 @@ export const calendarEvents = [ allDay: true, //className: "primary", extendedProps: { - calendar: "meeting", + calendar: "polres", }, }, { @@ -61,7 +61,7 @@ export const calendarEvents = [ allDay: true, // className: "danger", extendedProps: { - calendar: "holiday", + calendar: "polda", }, }, { @@ -72,84 +72,65 @@ export const calendarEvents = [ allDay: true, //className: "primary", extendedProps: { - calendar: "business", + calendar: "international", }, }, ]; -export const calendarCategories = [ +export const calendarCategories = [ { - label: "Business", - value: "business", + label: "Nasional", + value: "national", activeClass: "ring-primary-500 bg-primary-500", className: "group-hover:border-blue-500", }, { - label: "Personal", - value: "personal", + label: "Polda", + value: "polda", activeClass: "ring-success-500 bg-success-500", className: " group-hover:border-green-500", }, { - label: "Holiday", - value: "holiday", + label: "Polres", + value: "polres", activeClass: "ring-danger-500 bg-danger-500", className: " group-hover:border-red-500", }, { - label: "Family", - value: "family", + label: "Internasional", + value: "international", activeClass: "ring-info-500 bg-info-500", className: " group-hover:border-cyan-500", }, - { - label: "Meeting", - value: "meeting", - activeClass: "ring-warning-500 bg-warning-500", - className: " group-hover:border-yellow-500", - }, - { - label: "Etc", - value: "etc", - activeClass: "ring-info-500 bg-info-500", - className: " group-hover:border-cyan-500", - } ]; export const categories = [ { - label: "Business", - value: "business", - className: "data-[state=checked]:bg-primary data-[state=checked]:ring-primary", + label: "Nasional", + value: "national", + className: + "data-[state=checked]:bg-primary data-[state=checked]:ring-primary", }, { - label: "Personal", - value: "personal", + label: "Polda", + value: "polda", - className: "data-[state=checked]:bg-success data-[state=checked]:ring-success", + className: + "data-[state=checked]:bg-success data-[state=checked]:ring-success", }, { - label: "Holiday", - value: "holiday", - className: "data-[state=checked]:bg-destructive data-[state=checked]:ring-destructive ", + label: "Polres", + value: "polres", + className: + "data-[state=checked]:bg-destructive data-[state=checked]:ring-destructive ", }, { - label: "Family", - value: "family", + label: "Internasional", + value: "international", className: "data-[state=checked]:bg-info data-[state=checked]:ring-info ", }, - { - label: "Meeting", - value: "meeting", - className: "data-[state=checked]:bg-warning data-[state=checked]:ring-warning", - }, - { - label: "Etc", - value: "etc", - className: "data-[state=checked]:bg-info data-[state=checked]:ring-info", - } ]; -export type CalendarEvent = (typeof calendarEvents)[number] -export type CalendarCategory = (typeof calendarCategories)[number] -export type Category = (typeof categories)[number] \ No newline at end of file +export type CalendarEvent = (typeof calendarEvents)[number]; +export type CalendarCategory = (typeof calendarCategories)[number]; +export type Category = (typeof categories)[number]; diff --git a/app/[locale]/(protected)/blog/page.tsx b/app/[locale]/(protected)/blog/page.tsx index 72862e58..d95fcbe4 100644 --- a/app/[locale]/(protected)/blog/page.tsx +++ b/app/[locale]/(protected)/blog/page.tsx @@ -1,5 +1,36 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Card, CardContent } from "@/components/ui/card"; +import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table"; +import { Button } from "@/components/ui/button"; +import { UploadIcon } from "lucide-react"; +import BlogTable from "./table-blog/mediahub-table"; + const BlogPage = async () => { - return
    ; + return ( +
    + +
    + +
    +
    + Table Indeks +
    +
    + +
    +
    +
    + + + + + +
    +
    + ); }; export default BlogPage; diff --git a/app/[locale]/(protected)/blog/table-blog/data.ts b/app/[locale]/(protected)/blog/table-blog/data.ts new file mode 100644 index 00000000..6bb2b47a --- /dev/null +++ b/app/[locale]/(protected)/blog/table-blog/data.ts @@ -0,0 +1,65 @@ +export const data = [ + { + title: "Ops Mantap Praja & Pilkada 2024", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + status: "Terkirim", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + category: "Giat Pimpinan", + date: "15/10/2024 9:11", + tag: "percobaan", + }, +]; diff --git a/app/[locale]/(protected)/blog/table-blog/mediahub-table.tsx b/app/[locale]/(protected)/blog/table-blog/mediahub-table.tsx new file mode 100644 index 00000000..b7ea563b --- /dev/null +++ b/app/[locale]/(protected)/blog/table-blog/mediahub-table.tsx @@ -0,0 +1,284 @@ +"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; + category: string; + date: string; + tag: 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[] = [ + { + accessorKey: "title", + header: "Judul", + cell: ({ row }) => ( +
    +
    +

    + {row.getValue("title")} +

    +
    +
    + ), + }, + { + accessorKey: "category", + header: "Kategori ", + cell: ({ row }) => ( + {row.getValue("category")} + ), + }, + { + accessorKey: "date", + header: "Tanggal Unggah ", + cell: ({ row }) => ( + {row.getValue("date")} + ), + }, + { + accessorKey: "tag", + header: "Tag ", + cell: ({ row }) => ( + {row.getValue("tag")} + ), + }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, + { + id: "actions", + accessorKey: "action", + header: "Actions", + enableHiding: false, + cell: ({ row }) => { + return ( + + + + + + + + View + + + + Edit + + + + Delete + + + + ); + }, + }, +]; + +const BlogTable = () => { + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + 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 ( +
    +
    +
    + + + + + + +
    +
    + ) => + table.getColumn("status")?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
    +
    + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
    +
    + + {table.getPageOptions().map((page, pageIndex) => ( + + ))} + +
    +
    + ); +}; + +export default BlogTable; diff --git a/app/[locale]/(protected)/dashboard/analytics/components/recent-activity.tsx b/app/[locale]/(protected)/dashboard/analytics/components/recent-activity.tsx index e5dbe262..f684ed29 100644 --- a/app/[locale]/(protected)/dashboard/analytics/components/recent-activity.tsx +++ b/app/[locale]/(protected)/dashboard/analytics/components/recent-activity.tsx @@ -15,19 +15,19 @@ const RecentActivity = () => {
    -

    0 FOTO

    +

    0 FOTO

    -

    0 AUDIO VISUAL

    +

    0 AUDIO VISUAL

    -

    0 TEXT

    +

    0 TEXT

    -

    0 AUDIO

    +

    0 AUDIO

    ); diff --git a/app/[locale]/(protected)/dashboard/analytics/page.tsx b/app/[locale]/(protected)/dashboard/analytics/page.tsx index 12546613..d56455d3 100644 --- a/app/[locale]/(protected)/dashboard/analytics/page.tsx +++ b/app/[locale]/(protected)/dashboard/analytics/page.tsx @@ -45,7 +45,7 @@ const DashboardPage = () => {
    - + {"Total Produksi Konten"} diff --git a/app/[locale]/(protected)/planning/mediahub/page.tsx b/app/[locale]/(protected)/planning/mediahub/page.tsx index a0a67684..5c30bf7b 100644 --- a/app/[locale]/(protected)/planning/mediahub/page.tsx +++ b/app/[locale]/(protected)/planning/mediahub/page.tsx @@ -1,5 +1,30 @@ +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 TaskTable from "../../task/table-task/task-table"; +import MediahubTable from "./table-mediahub/mediahub-table"; + const MediahubPage = async () => { - return
    ; + return ( +
    + +
    + +
    +
    + Perencanaan : Kanal MediaHub +
    +
    +
    + + + + + +
    +
    + ); }; export default MediahubPage; diff --git a/app/[locale]/(protected)/planning/mediahub/table-mediahub/data.ts b/app/[locale]/(protected)/planning/mediahub/table-mediahub/data.ts new file mode 100644 index 00000000..47b07d64 --- /dev/null +++ b/app/[locale]/(protected)/planning/mediahub/table-mediahub/data.ts @@ -0,0 +1,47 @@ +export const data = [ + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, +]; diff --git a/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx b/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx new file mode 100644 index 00000000..1ba02331 --- /dev/null +++ b/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx @@ -0,0 +1,268 @@ +"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; + 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[] = [ + { + accessorKey: "title", + header: "Judul", + cell: ({ row }) => ( +
    +
    +

    + {row.getValue("title")} +

    +
    +
    + ), + }, + { + accessorKey: "date", + header: "Tanggal Unggah ", + cell: ({ row }) => ( + {row.getValue("date")} + ), + }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, + { + id: "actions", + accessorKey: "action", + header: "Actions", + enableHiding: false, + cell: ({ row }) => { + return ( + + + + + + + + View + + + + Edit + + + + Delete + + + + ); + }, + }, +]; + +const MediahubTable = () => { + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + 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 ( +
    +
    +
    + + + + + + +
    +
    + ) => + table.getColumn("status")?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
    +
    + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
    +
    + + {table.getPageOptions().map((page, pageIndex) => ( + + ))} + +
    +
    + ); +}; + +export default MediahubTable; diff --git a/app/[locale]/(protected)/planning/medsos-mediahub/page.tsx b/app/[locale]/(protected)/planning/medsos-mediahub/page.tsx index ba9349e2..e60f4e9e 100644 --- a/app/[locale]/(protected)/planning/medsos-mediahub/page.tsx +++ b/app/[locale]/(protected)/planning/medsos-mediahub/page.tsx @@ -1,5 +1,27 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Card, CardContent } from "@/components/ui/card"; +import MedsosTable from "./table-medsos/medsos-table"; + const MedsosMediahubPage = async () => { - return
    ; + return ( +
    + +
    + +
    +
    + Perencanaan : Kanal Medsos +
    +
    +
    + + + + + +
    +
    + ); }; export default MedsosMediahubPage; diff --git a/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/data.ts b/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/data.ts new file mode 100644 index 00000000..47b07d64 --- /dev/null +++ b/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/data.ts @@ -0,0 +1,47 @@ +export const data = [ + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Ops Mantap Praja & Pilkada 2024", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, + { + title: "Seputar Prestasi", + status: "Terkirim", + date: "15/10/2024 9:11", + }, +]; diff --git a/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/medsos-table.tsx b/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/medsos-table.tsx new file mode 100644 index 00000000..c6dbda3d --- /dev/null +++ b/app/[locale]/(protected)/planning/medsos-mediahub/table-medsos/medsos-table.tsx @@ -0,0 +1,268 @@ +"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; + 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[] = [ + { + accessorKey: "title", + header: "Judul", + cell: ({ row }) => ( +
    +
    +

    + {row.getValue("title")} +

    +
    +
    + ), + }, + { + accessorKey: "date", + header: "Tanggal Unggah ", + cell: ({ row }) => ( + {row.getValue("date")} + ), + }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, + { + id: "actions", + accessorKey: "action", + header: "Actions", + enableHiding: false, + cell: ({ row }) => { + return ( + + + + + + + + View + + + + Edit + + + + Delete + + + + ); + }, + }, +]; + +const MedsosTable = () => { + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + 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 ( +
    +
    +
    + + + + + + +
    +
    + ) => + table.getColumn("status")?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
    +
    + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
    +
    + + {table.getPageOptions().map((page, pageIndex) => ( + + ))} + +
    +
    + ); +}; + +export default MedsosTable; diff --git a/app/[locale]/(protected)/task/page.tsx b/app/[locale]/(protected)/task/page.tsx index cebd5d62..b1d44aa1 100644 --- a/app/[locale]/(protected)/task/page.tsx +++ b/app/[locale]/(protected)/task/page.tsx @@ -1,5 +1,35 @@ +import { Card, CardContent } from "@/components/ui/card"; +import TaskTable from "./table-task/task-table"; +import { Button } from "@/components/ui/button"; +import { UploadIcon } from "lucide-react"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; + const TaskPage = async () => { - return
    ; + return ( +
    + +
    + +
    +
    + Table Penugasan +
    +
    + +
    +
    +
    + + + + + +
    +
    + ); }; export default TaskPage; diff --git a/app/[locale]/(protected)/task/table-task/data.ts b/app/[locale]/(protected)/task/table-task/data.ts new file mode 100644 index 00000000..93d38fe7 --- /dev/null +++ b/app/[locale]/(protected)/task/table-task/data.ts @@ -0,0 +1,106 @@ +export const data = [ + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "paid", + date: "$231.26", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Liputan Kegiatan", + code: "PNMH-1287", + status: "due", + date: "$432.81", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "due", + date: "$437.65", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Pers Rilis", + code: "PNMH-1287", + status: "canceled", + date: "$387.55", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "canceled", + date: "$489.80", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Liputan Kegiatan", + code: "PNMH-1287", + status: "canceled", + date: "$421.45", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Pers Rilis", + code: "PNMH-1287", + status: "canceled", + date: "$207.61", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "paid", + date: "$392.86", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Pers Rilis", + code: "PNMH-1287", + status: "paid", + date: "$162.87", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "paid", + date: "$268.58", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Liputan Kegiatan", + code: "PNMH-1287", + status: "paid", + date: "$369.19", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Liputan Kegiatan", + code: "PNMH-1287", + status: "paid", + date: "$420.87", + category: "amplifikasi", + typeTask: "Mediahub", + }, + { + title: "Giat Pimpinan", + code: "PNMH-1287", + status: "paid", + date: "$420.26", + category: "amplifikasi", + typeTask: "Mediahub", + }, +]; diff --git a/app/[locale]/(protected)/task/table-task/task-table.tsx b/app/[locale]/(protected)/task/table-task/task-table.tsx new file mode 100644 index 00000000..f2bf3b66 --- /dev/null +++ b/app/[locale]/(protected)/task/table-task/task-table.tsx @@ -0,0 +1,298 @@ +"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; + code: string; + typeTask: string; + category: 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[] = [ + { + accessorKey: "title", + header: "Judul", + cell: ({ row }) => ( +
    +
    +

    + {row.getValue("title")} +

    +
    +
    + ), + }, + { + accessorKey: "code", + header: "Kode ", + cell: ({ row }) => ( + {row.getValue("code")} + ), + }, + { + accessorKey: "typeTask", + header: "Kode ", + cell: ({ row }) => ( + {row.getValue("typeTask")} + ), + }, + { + accessorKey: "category", + header: "Jenis Tugas ", + cell: ({ row }) => ( + {row.getValue("category")} + ), + }, + { + accessorKey: "date", + header: "Tanggal Unggah ", + cell: ({ row }) => ( + {row.getValue("date")} + ), + }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + const statusColors: Record = { + paid: "bg-success/20 text-success", + due: "bg-warning/20 text-warning", + canceled: "bg-destructive/20 text-destructive", + }; + const status = row.getValue("status"); + return ( + + {status} + + ); + }, + }, + { + id: "actions", + accessorKey: "action", + header: "Actions", + enableHiding: false, + cell: ({ row }) => { + return ( + + + + + + + + View + + + + Edit + + + + Delete + + + + ); + }, + }, +]; + +const TaskTable = () => { + const [sorting, setSorting] = React.useState([]); + const [columnFilters, setColumnFilters] = React.useState( + [] + ); + const [columnVisibility, setColumnVisibility] = + React.useState({}); + const [rowSelection, setRowSelection] = React.useState({}); + const [pagination, setPagination] = React.useState({ + 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 ( +
    +
    +
    + + + + + + +
    +
    + ) => + table.getColumn("status")?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
    +
    + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + No results. + + + )} + +
    +
    + + {table.getPageOptions().map((page, pageIndex) => ( + + ))} + +
    +
    + ); +}; + +export default TaskTable;