2026-11-19 20:22:01 +06:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { MainLayout } from '@/components/layout/MainLayout';
|
2026-11-21 00:06:55 +06:00
|
|
|
import type { VconAdminRole } from '@/lib/vconUiHelpers';
|
|
|
|
|
import React, { createContext, useContext } from 'react';
|
2026-11-19 20:22:01 +06:00
|
|
|
|
2026-11-21 00:06:55 +06:00
|
|
|
const VconRoleContext = createContext<VconAdminRole>('owner');
|
|
|
|
|
|
|
|
|
|
export function useVconRole(): VconAdminRole {
|
|
|
|
|
return useContext(VconRoleContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function VconShell({
|
|
|
|
|
role = 'owner',
|
|
|
|
|
children,
|
|
|
|
|
}: {
|
|
|
|
|
role?: VconAdminRole;
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}) {
|
|
|
|
|
return (
|
|
|
|
|
<VconRoleContext.Provider value={role}>
|
|
|
|
|
<MainLayout showSidebar={true}>{children}</MainLayout>
|
|
|
|
|
</VconRoleContext.Provider>
|
|
|
|
|
);
|
2026-11-19 20:22:01 +06:00
|
|
|
}
|