update lisensi prosess
tests / ci (push) Has been cancelled

This commit is contained in:
Wian Drs
2026-08-25 13:43:55 +07:00
parent 1e80be180e
commit 60946ddf37
58 changed files with 2903 additions and 165 deletions
+31 -5
View File
@@ -1,6 +1,8 @@
import { Link, usePage } from '@inertiajs/react';
import {
Building2,
BookOpen,
CreditCard,
LayoutGrid,
Network,
Settings2,
@@ -24,14 +26,19 @@ import type { NavItem } from '@/types';
export function AppSidebar() {
const { auth } = usePage().props;
if (!auth.user) {
return null;
}
const permissions = auth.permissions ?? [];
const mainNavItems: NavItem[] = [
{ title: 'Dashboard', href: dashboard(), icon: LayoutGrid },
...(!auth.user.is_platform_admin &&
auth.permissions.includes('device.view')
...(!auth.user.is_platform_admin && permissions.includes('device.view')
? [{ title: 'Perangkat', href: '/devices', icon: Network }]
: []),
...(!auth.user.is_platform_admin &&
auth.permissions.includes('device.user.view')
permissions.includes('device.user.view')
? [
{
title: 'Users Perangkat',
@@ -40,8 +47,22 @@ export function AppSidebar() {
},
]
: []),
{
title: 'Dokumentasi',
href: '/documentation/deployment',
icon: BookOpen,
},
...(!auth.user.is_platform_admin && permissions.includes('license.view')
? [
{
title: 'Lisensi & Tagihan',
href: '/billing',
icon: CreditCard,
},
]
: []),
...(!auth.user.is_platform_admin &&
auth.permissions.includes('device.credential.create')
permissions.includes('device.credential.create')
? [
{
title: 'Pengaturan Perangkat',
@@ -57,11 +78,16 @@ export function AppSidebar() {
href: '/administration/tenants',
icon: Building2,
},
{
title: 'Order Lisensi',
href: '/administration/billing-orders',
icon: CreditCard,
},
]
: []),
...(!auth.user.is_platform_admin &&
auth.user.tenant_id &&
auth.permissions.includes('user.view')
permissions.includes('user.view')
? [
{
title: 'Users',
@@ -0,0 +1,19 @@
import { Moon, Sun } from 'lucide-react';
import { useAppearance } from '@/hooks/use-appearance';
export default function PublicThemeToggle() {
const { resolvedAppearance, updateAppearance } = useAppearance();
const isDark = resolvedAppearance === 'dark';
return (
<button
type="button"
onClick={() => updateAppearance(isDark ? 'light' : 'dark')}
className="inline-flex size-10 items-center justify-center rounded-lg border border-border bg-background text-foreground transition hover:bg-muted"
aria-label={isDark ? 'Gunakan mode terang' : 'Gunakan mode gelap'}
title={isDark ? 'Mode terang' : 'Mode gelap'}
>
{isDark ? <Sun className="size-4" /> : <Moon className="size-4" />}
</button>
);
}