From a333b7924fd6643e94184ea8ce59d47c44b0f6cd Mon Sep 17 00:00:00 2001 From: "fredy.siswanto" Date: Thu, 27 Feb 2025 00:09:47 +0700 Subject: [PATCH] feat: enhance subscriptions page with status rendering and search/filter functionality --- app/pages/dashboard-subscriptions/index.tsx | 168 ++++++++++++++++---- 1 file changed, 135 insertions(+), 33 deletions(-) diff --git a/app/pages/dashboard-subscriptions/index.tsx b/app/pages/dashboard-subscriptions/index.tsx index f9b3a69..8d05fcd 100644 --- a/app/pages/dashboard-subscriptions/index.tsx +++ b/app/pages/dashboard-subscriptions/index.tsx @@ -1,7 +1,9 @@ +import { Field, Input, Label, Select } from '@headlessui/react' import DT from 'datatables.net-dt' import DataTable from 'datatables.net-react' import { useState } from 'react' +import { SearchIcon } from '~/components/icons/search' import { Button } from '~/components/ui/button' import { TitleDashboard } from '~/components/ui/title-dashboard' @@ -17,8 +19,13 @@ export const SubscriptionsPage = () => { { title: 'Nama User', data: 'name' }, { title: 'Email', data: 'email' }, { title: 'Kategori', data: 'category' }, - { title: 'Status', data: 'status' }, - { title: 'Action', data: 'id', render: () => 'Subscribed' }, + { + title: 'Status', + data: 'status', + render: () => { + return `Subscribed` + }, + }, ] const colTableSubSetting = [ { title: 'No', data: 'id' }, @@ -26,7 +33,15 @@ export const SubscriptionsPage = () => { { title: 'Nama Subscription', data: 'subscriber' }, { title: 'Price', data: 'price' }, { title: 'Length', data: 'length' }, - { title: 'Status', data: 'status', render: () => 'Active' }, + { + title: 'Status', + data: 'status', + render: (value: string) => { + return value == 'active' + ? `${value}` + : `${value}` + }, + }, ] const switchViee = () => { @@ -36,41 +51,128 @@ export const SubscriptionsPage = () => { return (
-
- -
+ {SubscribtionOpen && ( - + <> +
+
+ + +
+ +
+ +
+
+
+
+ +
+ + + + +
+
+ +
+

+ Daftar Subscription +

+ + +
+ )} {!SubscribtionOpen && ( - + <> +
+
+ + +
+ +
+
+
+
+ + +
+ +
+
+
+ +
+ + + + +
+
+
+

+ Daftar Subscription +

+ +
+ )}
)