@yimingliao/cms 0.0.151 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/client/components/index.js +17 -8
- package/dist/export/client/components/resources/index.js +17 -0
- package/dist/export/client/shadcn/index.js +3 -1
- package/dist/src/client/interfaces/components/resources/admin/admin-card.js +81 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-list.js +126 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.js +55 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.js +19 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.js +73 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.js +20 -0
- package/dist/src/client/interfaces/components/resources/admin/admin-relations-section.js +79 -0
- package/dist/src/client/interfaces/components/resources/category/category-card.js +80 -0
- package/dist/src/client/interfaces/components/resources/category/category-list.js +154 -0
- package/dist/src/client/interfaces/components/resources/category/category-relations-section.js +76 -0
- package/dist/src/client/interfaces/components/resources/file/file-card.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/file-list.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/file-relations-section.js +112 -0
- package/dist/src/client/interfaces/components/resources/file/is-locked-buttons.js +1 -0
- package/dist/src/client/interfaces/components/resources/file/type-buttons.js +1 -0
- package/dist/src/client/interfaces/components/resources/post/control-fields-buttons.js +111 -0
- package/dist/src/client/interfaces/components/resources/post/post-card.js +112 -0
- package/dist/src/client/interfaces/components/resources/post/post-list.js +162 -0
- package/dist/src/client/interfaces/components/resources/post/post-relations-section.js +76 -0
- package/dist/src/client/interfaces/components/resources/post/post-status-bar-icons.js +24 -0
- package/dist/src/client/interfaces/components/resources/post/post-type-gate.js +13 -0
- package/dist/src/client/interfaces/components/shadcn/item.js +181 -0
- package/dist/src/client/interfaces/components/shadcn/table.js +111 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +1 -0
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +1 -0
- package/dist/src/client/interfaces/components/ui/buttons/button.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/action-buttons-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-status-bar.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/card-text-content.js +1 -0
- package/dist/src/client/interfaces/components/ui/cards/resource-card/resource-card.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/array-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/badge.js +1 -0
- package/dist/src/client/interfaces/components/ui/display/object-array-list.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/accordion/accordion-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-info.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-info/file-name.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-container.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-picker/file-picker-placeholder.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/file/file-preview/file-preview.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +1 -0
- package/dist/src/client/interfaces/components/ui/features/pick-modal/pick-modal.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field-body.js +1 -0
- package/dist/src/client/interfaces/components/ui/form/field.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-array-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/display/i18n-object-array-display.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/i18n-tabs-wrapper.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-date-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-editor.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-json-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-number-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/i18n/inputs/i18n-textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/editor/editor.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/select.js +1 -0
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/auth-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/dashboard-skeleton.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +2 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +1 -0
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +1 -0
- package/dist/src/client/interfaces/pages/auth/change-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/email-unverified/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/forgot-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/layout.js +1 -0
- package/dist/src/client/interfaces/pages/auth/reset-password/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/sign-in/page.js +1 -0
- package/dist/src/client/interfaces/pages/auth/verify-email/page.js +1 -0
- package/dist/src/client/interfaces/pages/dashboard/layout.js +1 -0
- package/dist/types/export/client/components/resources/index.d.ts +2 -0
- package/dist/types/export/client/components/resources/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-card.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-list.d.ts +19 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-refresh-tokens/related-admin-refresh-tokens.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/admin/admin-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/admin/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/admin/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-card.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts +20 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/category/category-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/category/index.d.ts +4 -0
- package/dist/types/src/client/interfaces/components/resources/category/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts +12 -0
- package/dist/types/src/client/interfaces/components/resources/file/file-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/index.d.ts +1 -0
- package/dist/types/src/client/interfaces/components/resources/file/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts +4 -1
- package/dist/types/src/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts +16 -0
- package/dist/types/src/client/interfaces/components/resources/post/control-fields-buttons.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/index.d.ts +6 -0
- package/dist/types/src/client/interfaces/components/resources/post/index.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-card.d.ts +14 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-card.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts +25 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-list.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-relations-section.d.ts +9 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-relations-section.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-status-bar-icons.d.ts +8 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-status-bar-icons.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-type-gate.d.ts +10 -0
- package/dist/types/src/client/interfaces/components/resources/post/post-type-gate.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts +3 -1
- package/dist/types/src/client/interfaces/components/shadcn/index.d.ts.map +1 -1
- package/dist/types/src/client/interfaces/components/shadcn/item.d.ts +24 -0
- package/dist/types/src/client/interfaces/components/shadcn/item.d.ts.map +1 -0
- package/dist/types/src/client/interfaces/components/shadcn/table.d.ts +11 -0
- package/dist/types/src/client/interfaces/components/shadcn/table.d.ts.map +1 -0
- package/package.json +5 -1
|
@@ -36,26 +36,29 @@ export { PasswordInput } from '../../../src/client/interfaces/components/ui/inpu
|
|
|
36
36
|
export { SearchInput } from '../../../src/client/interfaces/components/ui/inputs/search-input.js';
|
|
37
37
|
export { Option, Select } from '../../../src/client/interfaces/components/ui/inputs/select.js';
|
|
38
38
|
export { Textarea } from '../../../src/client/interfaces/components/ui/inputs/textarea.js';
|
|
39
|
-
export { createFileCard } from '../../../src/client/interfaces/components/resources/file/file-card.js';
|
|
40
|
-
export { createFileList } from '../../../src/client/interfaces/components/resources/file/file-list.js';
|
|
41
|
-
export { createNavbar } from '../../../src/client/interfaces/components/ui/layouts/navbar/navbar.js';
|
|
42
|
-
export { createI18nSelector } from '../../../src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js';
|
|
43
|
-
export { createSignOutButton } from '../../../src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js';
|
|
44
|
-
export { NavMain } from '../../../src/client/interfaces/components/ui/layouts/sidebar/nav-main.js';
|
|
45
39
|
import 'react/jsx-runtime';
|
|
46
|
-
import '
|
|
40
|
+
import 'intor/react';
|
|
41
|
+
import 'lucide-react';
|
|
42
|
+
import '../../../src/constants/paths/auth.js';
|
|
43
|
+
import '../../../src/constants/paths/main.js';
|
|
44
|
+
import '../../../src/constants/paths/resources.js';
|
|
45
|
+
import '../../../src/constants/redirect-paths.js';
|
|
46
|
+
import '../../../src/domain/resources/admin/constants.js';
|
|
47
|
+
import 'mime-types';
|
|
47
48
|
import 'react';
|
|
48
49
|
import 'ua-parser-js';
|
|
49
50
|
import 'clsx';
|
|
50
51
|
import 'tailwind-merge';
|
|
51
52
|
import 'next/navigation';
|
|
53
|
+
import 'next/link';
|
|
54
|
+
import '@radix-ui/react-avatar';
|
|
52
55
|
import '../../../src/client/interfaces/components/shadcn/badge.js';
|
|
53
56
|
import '../../../src/client/interfaces/components/shadcn/button.js';
|
|
54
57
|
import '@radix-ui/react-collapsible';
|
|
55
58
|
import '@radix-ui/react-dialog';
|
|
56
|
-
import 'lucide-react';
|
|
57
59
|
import '@radix-ui/react-dropdown-menu';
|
|
58
60
|
import '../../../src/client/interfaces/components/shadcn/input-group.js';
|
|
61
|
+
import '../../../src/client/interfaces/components/shadcn/item.js';
|
|
59
62
|
import '@radix-ui/react-label';
|
|
60
63
|
import '@radix-ui/react-select';
|
|
61
64
|
import '@radix-ui/react-separator';
|
|
@@ -64,6 +67,12 @@ import 'next-themes';
|
|
|
64
67
|
import 'sonner';
|
|
65
68
|
import '@radix-ui/react-tabs';
|
|
66
69
|
import '@radix-ui/react-tooltip';
|
|
70
|
+
export { createFileCard } from '../../../src/client/interfaces/components/resources/file/file-card.js';
|
|
71
|
+
export { createFileList } from '../../../src/client/interfaces/components/resources/file/file-list.js';
|
|
72
|
+
export { createNavbar } from '../../../src/client/interfaces/components/ui/layouts/navbar/navbar.js';
|
|
73
|
+
export { createI18nSelector } from '../../../src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js';
|
|
74
|
+
export { createSignOutButton } from '../../../src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js';
|
|
75
|
+
export { NavMain } from '../../../src/client/interfaces/components/ui/layouts/sidebar/nav-main.js';
|
|
67
76
|
export { ContentContainer } from '../../../src/client/interfaces/components/ui/layouts/content-container.js';
|
|
68
77
|
export { createI18nTabsWrapper } from '../../../src/client/interfaces/components/ui/i18n/i18n-tabs-wrapper.js';
|
|
69
78
|
export { createI18nDisplay } from '../../../src/client/interfaces/components/ui/i18n/display/i18n-display.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { AdminCard } from '../../../../src/client/interfaces/components/resources/admin/admin-card.js';
|
|
2
|
+
export { createAdminList } from '../../../../src/client/interfaces/components/resources/admin/admin-list.js';
|
|
3
|
+
export { createAdminRelationsSection } from '../../../../src/client/interfaces/components/resources/admin/admin-relations-section.js';
|
|
4
|
+
export { ActiveSessionsBadge } from '../../../../src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-sessions-badge.js';
|
|
5
|
+
export { AdminRefreshTokenCard } from '../../../../src/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.js';
|
|
6
|
+
export { createFileCard } from '../../../../src/client/interfaces/components/resources/file/file-card.js';
|
|
7
|
+
export { createFileList } from '../../../../src/client/interfaces/components/resources/file/file-list.js';
|
|
8
|
+
export { createFileRelationsSection } from '../../../../src/client/interfaces/components/resources/file/file-relations-section.js';
|
|
9
|
+
export { createPostCard } from '../../../../src/client/interfaces/components/resources/post/post-card.js';
|
|
10
|
+
export { createPostList } from '../../../../src/client/interfaces/components/resources/post/post-list.js';
|
|
11
|
+
export { createPostRelationsSection } from '../../../../src/client/interfaces/components/resources/post/post-relations-section.js';
|
|
12
|
+
import 'react/jsx-runtime';
|
|
13
|
+
import 'lucide-react';
|
|
14
|
+
export { PostTypeGate } from '../../../../src/client/interfaces/components/resources/post/post-type-gate.js';
|
|
15
|
+
export { CategoryCard } from '../../../../src/client/interfaces/components/resources/category/category-card.js';
|
|
16
|
+
export { createCategoryList } from '../../../../src/client/interfaces/components/resources/category/category-list.js';
|
|
17
|
+
export { createCategoryRelationsSection } from '../../../../src/client/interfaces/components/resources/category/category-relations-section.js';
|
|
@@ -5,8 +5,9 @@ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader,
|
|
|
5
5
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../../src/client/interfaces/components/shadcn/collapsible.js';
|
|
6
6
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from '../../../src/client/interfaces/components/shadcn/dialog.js';
|
|
7
7
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '../../../src/client/interfaces/components/shadcn/dropdown-menu.js';
|
|
8
|
-
export { Input } from '../../../src/client/interfaces/components/shadcn/input.js';
|
|
9
8
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from '../../../src/client/interfaces/components/shadcn/input-group.js';
|
|
9
|
+
export { Input } from '../../../src/client/interfaces/components/shadcn/input.js';
|
|
10
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle } from '../../../src/client/interfaces/components/shadcn/item.js';
|
|
10
11
|
export { Label } from '../../../src/client/interfaces/components/shadcn/label.js';
|
|
11
12
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from '../../../src/client/interfaces/components/shadcn/pagination.js';
|
|
12
13
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from '../../../src/client/interfaces/components/shadcn/select.js';
|
|
@@ -16,6 +17,7 @@ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupActio
|
|
|
16
17
|
export { Skeleton } from '../../../src/client/interfaces/components/shadcn/skeleton.js';
|
|
17
18
|
export { Toaster } from '../../../src/client/interfaces/components/shadcn/sonner.js';
|
|
18
19
|
export { Spinner } from '../../../src/client/interfaces/components/shadcn/spinner.js';
|
|
20
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from '../../../src/client/interfaces/components/shadcn/table.js';
|
|
19
21
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../src/client/interfaces/components/shadcn/tabs.js';
|
|
20
22
|
export { Textarea } from '../../../src/client/interfaces/components/shadcn/textarea.js';
|
|
21
23
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../../src/client/interfaces/components/shadcn/tooltip.js';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import { File, Lock } from 'lucide-react';
|
|
5
|
+
import { PATHS } from '../../../../../constants/paths/index.js';
|
|
6
|
+
import '../../../../../constants/redirect-paths.js';
|
|
7
|
+
import { ADMIN_ROLE_I18N_MAP } from '../../../../../domain/resources/admin/constants.js';
|
|
8
|
+
import 'mime-types';
|
|
9
|
+
import { findTranslation } from '../../../../../shared/translation/find-translation.js';
|
|
10
|
+
import 'react';
|
|
11
|
+
import 'ua-parser-js';
|
|
12
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
13
|
+
import 'next/navigation';
|
|
14
|
+
import '@radix-ui/react-avatar';
|
|
15
|
+
import '../../shadcn/badge.js';
|
|
16
|
+
import '../../shadcn/button.js';
|
|
17
|
+
import '@radix-ui/react-collapsible';
|
|
18
|
+
import '@radix-ui/react-dialog';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../shadcn/input-group.js';
|
|
21
|
+
import '../../shadcn/item.js';
|
|
22
|
+
import '@radix-ui/react-label';
|
|
23
|
+
import '@radix-ui/react-select';
|
|
24
|
+
import '@radix-ui/react-separator';
|
|
25
|
+
import '../../shadcn/sidebar.js';
|
|
26
|
+
import 'next-themes';
|
|
27
|
+
import 'sonner';
|
|
28
|
+
import '@radix-ui/react-tabs';
|
|
29
|
+
import '@radix-ui/react-tooltip';
|
|
30
|
+
import { ResourceCard } from '../../ui/cards/resource-card/resource-card.js';
|
|
31
|
+
import 'next/link';
|
|
32
|
+
import 'next/image';
|
|
33
|
+
import { RelatedAdminRefreshTokens } from './admin-refresh-tokens/related-admin-refresh-tokens.js';
|
|
34
|
+
|
|
35
|
+
const WIDTH = "240px";
|
|
36
|
+
function AdminCard({
|
|
37
|
+
admin,
|
|
38
|
+
// link
|
|
39
|
+
openNewTab = false,
|
|
40
|
+
anchorProps,
|
|
41
|
+
// base
|
|
42
|
+
className = ""
|
|
43
|
+
}) {
|
|
44
|
+
const { t, locale } = useTranslator();
|
|
45
|
+
const name = findTranslation(admin?.translations, locale)?.name;
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
ResourceCard,
|
|
48
|
+
{
|
|
49
|
+
className,
|
|
50
|
+
style: { width: WIDTH },
|
|
51
|
+
href: `${PATHS.resources.admin.path}/${admin?.id}`,
|
|
52
|
+
openNewTab,
|
|
53
|
+
anchorProps,
|
|
54
|
+
cardStatusBarProps: {
|
|
55
|
+
badge: t(ADMIN_ROLE_I18N_MAP[admin?.role || "ADMIN"]),
|
|
56
|
+
children: admin?.role === "SUPER_ADMIN" && /* @__PURE__ */ jsx(Lock, { className: "size-4" })
|
|
57
|
+
},
|
|
58
|
+
cardTextContentProps: {
|
|
59
|
+
title: name,
|
|
60
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1"), children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
RelatedAdminRefreshTokens,
|
|
63
|
+
{
|
|
64
|
+
isActive: !!admin && "adminRefreshTokens" in admin && admin.adminRefreshTokens?.length > 0,
|
|
65
|
+
children: admin && "adminRefreshTokens" in admin ? admin.adminRefreshTokens.length : /* @__PURE__ */ jsx("span", { className: "text-xs opacity-50", children: t("resources.see-in-details.text") })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(File, { className: "size-4" }),
|
|
70
|
+
/* @__PURE__ */ jsxs("p", { className: "truncate", children: [
|
|
71
|
+
":\xA0",
|
|
72
|
+
admin && "posts" in admin ? admin.posts.length : /* @__PURE__ */ jsx("span", { className: "text-xs opacity-50", children: t("resources.see-in-details.text") })
|
|
73
|
+
] })
|
|
74
|
+
] })
|
|
75
|
+
] })
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { AdminCard };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import '../../../../../constants/paths/auth.js';
|
|
5
|
+
import '../../../../../constants/paths/main.js';
|
|
6
|
+
import '../../../../../constants/paths/resources.js';
|
|
7
|
+
import { CACHE_KEYS } from '../../../../../constants/cache-keys.js';
|
|
8
|
+
import '../../../../../constants/redirect-paths.js';
|
|
9
|
+
import 'mime-types';
|
|
10
|
+
import { debounce } from '../../../../../shared/utils/debounce.js';
|
|
11
|
+
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
12
|
+
import 'ua-parser-js';
|
|
13
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
14
|
+
import 'next/navigation';
|
|
15
|
+
import 'intor/react';
|
|
16
|
+
import 'lucide-react';
|
|
17
|
+
import '@radix-ui/react-avatar';
|
|
18
|
+
import '../../shadcn/badge.js';
|
|
19
|
+
import '../../shadcn/button.js';
|
|
20
|
+
import '@radix-ui/react-collapsible';
|
|
21
|
+
import '@radix-ui/react-dialog';
|
|
22
|
+
import '@radix-ui/react-dropdown-menu';
|
|
23
|
+
import '../../shadcn/input-group.js';
|
|
24
|
+
import '../../shadcn/item.js';
|
|
25
|
+
import '@radix-ui/react-label';
|
|
26
|
+
import '@radix-ui/react-select';
|
|
27
|
+
import '@radix-ui/react-separator';
|
|
28
|
+
import '../../shadcn/sidebar.js';
|
|
29
|
+
import 'next-themes';
|
|
30
|
+
import 'sonner';
|
|
31
|
+
import '@radix-ui/react-tabs';
|
|
32
|
+
import '@radix-ui/react-tooltip';
|
|
33
|
+
import { ListCardsContainer } from '../../ui/blocks/list-cards-container/list-cards-container.js';
|
|
34
|
+
import 'next/link';
|
|
35
|
+
import '../../../../../domain/resources/admin/constants.js';
|
|
36
|
+
import 'next/image';
|
|
37
|
+
import { Tick } from '../../ui/features/tick.js';
|
|
38
|
+
import { AdminCard } from './admin-card.js';
|
|
39
|
+
|
|
40
|
+
function createAdminList({
|
|
41
|
+
useQuery,
|
|
42
|
+
adminFindListCardsAction
|
|
43
|
+
}) {
|
|
44
|
+
return function AdminList({
|
|
45
|
+
setItemStates,
|
|
46
|
+
// Fetch Condition
|
|
47
|
+
adminIds,
|
|
48
|
+
// Link Props
|
|
49
|
+
openNewTab,
|
|
50
|
+
// Pick Mode
|
|
51
|
+
pickedItems,
|
|
52
|
+
handleClick
|
|
53
|
+
}) {
|
|
54
|
+
const [page, setPage] = useState(1);
|
|
55
|
+
const [pageSize, setPageSize] = useState(20);
|
|
56
|
+
const [searchString, setSearchString] = useState("");
|
|
57
|
+
const debouncedSetSearchString = useMemo(
|
|
58
|
+
() => debounce((v) => setSearchString(v), 300),
|
|
59
|
+
[]
|
|
60
|
+
);
|
|
61
|
+
const { data, isFetching } = useQuery(
|
|
62
|
+
() => adminFindListCardsAction({
|
|
63
|
+
page,
|
|
64
|
+
pageSize,
|
|
65
|
+
searchString,
|
|
66
|
+
...adminIds && { adminIds }
|
|
67
|
+
}),
|
|
68
|
+
[
|
|
69
|
+
CACHE_KEYS.findListCards("admin"),
|
|
70
|
+
page,
|
|
71
|
+
pageSize,
|
|
72
|
+
searchString,
|
|
73
|
+
JSON.stringify(adminIds)
|
|
74
|
+
]
|
|
75
|
+
);
|
|
76
|
+
const admins = useMemo(() => ensureArray(data?.items), [data?.items]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
setItemStates?.({
|
|
79
|
+
items: admins,
|
|
80
|
+
count: data?.total ?? 0,
|
|
81
|
+
isFetching
|
|
82
|
+
});
|
|
83
|
+
}, [admins, data?.total, isFetching, setItemStates]);
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
ListCardsContainer,
|
|
86
|
+
{
|
|
87
|
+
page,
|
|
88
|
+
setPage,
|
|
89
|
+
pageSize,
|
|
90
|
+
setPageSize,
|
|
91
|
+
total: data?.total ?? 0,
|
|
92
|
+
searchString,
|
|
93
|
+
setSearchString: debouncedSetSearchString,
|
|
94
|
+
isFetching,
|
|
95
|
+
children: admins.map((admin) => {
|
|
96
|
+
const isPicked = pickedItems?.some((item) => item.id === admin.id);
|
|
97
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-fit", children: [
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
AdminCard,
|
|
100
|
+
{
|
|
101
|
+
admin,
|
|
102
|
+
openNewTab: openNewTab ?? false,
|
|
103
|
+
className: cn(pickedItems && !isPicked && "opacity-50"),
|
|
104
|
+
anchorProps: handleClick && {
|
|
105
|
+
onClick: (e) => {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
handleClick(admin);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
pickedItems && /* @__PURE__ */ jsx(
|
|
113
|
+
Tick,
|
|
114
|
+
{
|
|
115
|
+
isPicked: isPicked ?? false,
|
|
116
|
+
className: "absolute top-2 right-2"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }, admin.id);
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { createAdminList };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { KEYS } from '../../../../../../constants/keys/index.js';
|
|
6
|
+
import { PATHS } from '../../../../../../constants/paths/index.js';
|
|
7
|
+
import '../../../../../../constants/redirect-paths.js';
|
|
8
|
+
import '@radix-ui/react-avatar';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'ua-parser-js';
|
|
11
|
+
import 'clsx';
|
|
12
|
+
import 'tailwind-merge';
|
|
13
|
+
import 'next/navigation';
|
|
14
|
+
import '../../../shadcn/badge.js';
|
|
15
|
+
import '../../../shadcn/button.js';
|
|
16
|
+
import '@radix-ui/react-collapsible';
|
|
17
|
+
import '@radix-ui/react-dialog';
|
|
18
|
+
import 'lucide-react';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../../shadcn/input-group.js';
|
|
21
|
+
import { ItemGroup, Item, ItemContent, ItemTitle, ItemDescription } from '../../../shadcn/item.js';
|
|
22
|
+
import '@radix-ui/react-label';
|
|
23
|
+
import '@radix-ui/react-select';
|
|
24
|
+
import '@radix-ui/react-separator';
|
|
25
|
+
import '../../../shadcn/sidebar.js';
|
|
26
|
+
import 'next-themes';
|
|
27
|
+
import 'sonner';
|
|
28
|
+
import { Spinner } from '../../../shadcn/spinner.js';
|
|
29
|
+
import '@radix-ui/react-tabs';
|
|
30
|
+
import '@radix-ui/react-tooltip';
|
|
31
|
+
import { ActiveSpot } from './active-spot.js';
|
|
32
|
+
|
|
33
|
+
function ActiveSessionsBadge({
|
|
34
|
+
adminId = "",
|
|
35
|
+
adminRefreshTokens,
|
|
36
|
+
isLoading = false
|
|
37
|
+
}) {
|
|
38
|
+
const { t } = useTranslator();
|
|
39
|
+
return /* @__PURE__ */ jsx(ItemGroup, { className: "gap-4", children: /* @__PURE__ */ jsx(Item, { variant: "outline", asChild: true, role: "listitem", className: "h-9 py-0", children: /* @__PURE__ */ jsxs(
|
|
40
|
+
Link,
|
|
41
|
+
{
|
|
42
|
+
href: `${PATHS.resources.admin.path}/${adminId}/${KEYS.resources.adminRefreshToken.key}`,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(ActiveSpot, { isActive: adminRefreshTokens.length > 0 }),
|
|
45
|
+
/* @__PURE__ */ jsx(ItemContent, { children: /* @__PURE__ */ jsxs(ItemTitle, { className: "line-clamp-1", children: [
|
|
46
|
+
t("resources.admin-refresh-token.text"),
|
|
47
|
+
" :"
|
|
48
|
+
] }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(ItemContent, { className: "flex-none text-center", children: /* @__PURE__ */ jsx(ItemDescription, { className: "min-w-5 font-semibold", children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : adminRefreshTokens.length }) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
) }) });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { ActiveSessionsBadge };
|
package/dist/src/client/interfaces/components/resources/admin/admin-refresh-tokens/active-spot.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'ua-parser-js';
|
|
4
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
5
|
+
import 'next/navigation';
|
|
6
|
+
|
|
7
|
+
function ActiveSpot({ isActive }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: cn(
|
|
12
|
+
"size-3 rounded-full",
|
|
13
|
+
isActive ? "bg-success animate-pulse" : "bg-accent"
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { ActiveSpot };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslator } from 'intor/react';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'ua-parser-js';
|
|
5
|
+
import { cn } from '../../../../../applications/shadcn/utils.js';
|
|
6
|
+
import 'next/navigation';
|
|
7
|
+
import '@radix-ui/react-avatar';
|
|
8
|
+
import '../../../shadcn/badge.js';
|
|
9
|
+
import '../../../shadcn/button.js';
|
|
10
|
+
import { Card } from '../../../shadcn/card.js';
|
|
11
|
+
import '@radix-ui/react-collapsible';
|
|
12
|
+
import '@radix-ui/react-dialog';
|
|
13
|
+
import 'lucide-react';
|
|
14
|
+
import '@radix-ui/react-dropdown-menu';
|
|
15
|
+
import '../../../shadcn/input-group.js';
|
|
16
|
+
import '../../../shadcn/item.js';
|
|
17
|
+
import '@radix-ui/react-label';
|
|
18
|
+
import '@radix-ui/react-select';
|
|
19
|
+
import '@radix-ui/react-separator';
|
|
20
|
+
import '../../../shadcn/sidebar.js';
|
|
21
|
+
import 'next-themes';
|
|
22
|
+
import 'sonner';
|
|
23
|
+
import { Table, TableBody, TableRow, TableCell } from '../../../shadcn/table.js';
|
|
24
|
+
import '@radix-ui/react-tabs';
|
|
25
|
+
import '@radix-ui/react-tooltip';
|
|
26
|
+
import { Button } from '../../../ui/buttons/button.js';
|
|
27
|
+
import 'next/link';
|
|
28
|
+
import '../../../../../../constants/paths/auth.js';
|
|
29
|
+
import '../../../../../../constants/paths/main.js';
|
|
30
|
+
import '../../../../../../constants/paths/resources.js';
|
|
31
|
+
import '../../../../../../constants/redirect-paths.js';
|
|
32
|
+
import 'mime-types';
|
|
33
|
+
import '../../../../../../domain/resources/admin/constants.js';
|
|
34
|
+
import 'next/image';
|
|
35
|
+
|
|
36
|
+
function AdminRefreshTokenCard({
|
|
37
|
+
adminRefreshToken,
|
|
38
|
+
isCurrent,
|
|
39
|
+
isDestroying,
|
|
40
|
+
handleDestroy
|
|
41
|
+
}) {
|
|
42
|
+
const { t } = useTranslator();
|
|
43
|
+
const { createdAt, expiresAt, ip, deviceInfo = {} } = adminRefreshToken || {};
|
|
44
|
+
const { deviceType, platform, timezone, language, browser } = deviceInfo;
|
|
45
|
+
const fields = [
|
|
46
|
+
{ label: "Created At", value: createdAt?.toLocaleString() },
|
|
47
|
+
{ label: "Expires At", value: expiresAt?.toLocaleString() },
|
|
48
|
+
{ label: "IP Address", value: ip },
|
|
49
|
+
{ label: "Device Type", value: deviceType },
|
|
50
|
+
{ label: "Platform", value: platform },
|
|
51
|
+
{ label: "Timezone", value: timezone },
|
|
52
|
+
{ label: "Language", value: language },
|
|
53
|
+
{ label: "Browser", value: browser }
|
|
54
|
+
];
|
|
55
|
+
return /* @__PURE__ */ jsxs(Card, { className: cn("h-96 w-80 justify-between gap-0 p-4"), children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Table, { children: /* @__PURE__ */ jsx(TableBody, { children: fields.map(({ label, value }) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: label }),
|
|
58
|
+
/* @__PURE__ */ jsx(TableCell, { children: value })
|
|
59
|
+
] }, label)) }) }),
|
|
60
|
+
isCurrent ? /* @__PURE__ */ jsx(Button, { variant: "secondary", isDisabled: true, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: t("resources.admin-refresh-token.current-session.text") }) }) : /* @__PURE__ */ jsx(
|
|
61
|
+
Button,
|
|
62
|
+
{
|
|
63
|
+
variant: "destructive",
|
|
64
|
+
isDisabled: isDestroying,
|
|
65
|
+
isLoading: isDestroying,
|
|
66
|
+
onClick: () => void handleDestroy?.(adminRefreshToken?.tokenHash ?? ""),
|
|
67
|
+
children: t("resources.admin-refresh-token.delete-session.text")
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { AdminRefreshTokenCard };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslator } from 'intor/react';
|
|
3
|
+
import { ActiveSpot } from './active-spot.js';
|
|
4
|
+
|
|
5
|
+
function RelatedAdminRefreshTokens({
|
|
6
|
+
isActive,
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
const { t } = useTranslator();
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "flex-center size-4", children: /* @__PURE__ */ jsx(ActiveSpot, { isActive }) }),
|
|
12
|
+
/* @__PURE__ */ jsxs("p", { className: "truncate", children: [
|
|
13
|
+
t("resources.admin-refresh-token.text"),
|
|
14
|
+
":\xA0",
|
|
15
|
+
children
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { RelatedAdminRefreshTokens };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import '../../../../../domain/resources/admin/constants.js';
|
|
5
|
+
import { POST_TYPES } from '../../../../../domain/resources/post/props.js';
|
|
6
|
+
import 'mime-types';
|
|
7
|
+
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
8
|
+
import 'lucide-react';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'ua-parser-js';
|
|
11
|
+
import 'clsx';
|
|
12
|
+
import 'tailwind-merge';
|
|
13
|
+
import 'next/navigation';
|
|
14
|
+
import '@radix-ui/react-avatar';
|
|
15
|
+
import '../../shadcn/badge.js';
|
|
16
|
+
import '../../shadcn/button.js';
|
|
17
|
+
import '@radix-ui/react-collapsible';
|
|
18
|
+
import '@radix-ui/react-dialog';
|
|
19
|
+
import '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import '../../shadcn/input-group.js';
|
|
21
|
+
import '../../shadcn/item.js';
|
|
22
|
+
import '@radix-ui/react-label';
|
|
23
|
+
import '@radix-ui/react-select';
|
|
24
|
+
import '@radix-ui/react-separator';
|
|
25
|
+
import '../../shadcn/sidebar.js';
|
|
26
|
+
import 'next-themes';
|
|
27
|
+
import 'sonner';
|
|
28
|
+
import '@radix-ui/react-tabs';
|
|
29
|
+
import '@radix-ui/react-tooltip';
|
|
30
|
+
import 'next/link';
|
|
31
|
+
import '../../../../../constants/paths/auth.js';
|
|
32
|
+
import '../../../../../constants/paths/main.js';
|
|
33
|
+
import '../../../../../constants/paths/resources.js';
|
|
34
|
+
import '../../../../../constants/redirect-paths.js';
|
|
35
|
+
import { Accordion } from '../../ui/features/accordion/accordion.js';
|
|
36
|
+
import { AccordionContainer } from '../../ui/features/accordion/accordion-container.js';
|
|
37
|
+
import 'next/image';
|
|
38
|
+
|
|
39
|
+
function createAdminRelationsSection({
|
|
40
|
+
PostList
|
|
41
|
+
}) {
|
|
42
|
+
return function AdminRelationsSection({
|
|
43
|
+
admin,
|
|
44
|
+
usableFields = [
|
|
45
|
+
"isActive",
|
|
46
|
+
"isIndexActive",
|
|
47
|
+
"isSlugActive",
|
|
48
|
+
"isFeatured",
|
|
49
|
+
"isShownOnHome"
|
|
50
|
+
]
|
|
51
|
+
}) {
|
|
52
|
+
const { t } = useTranslator();
|
|
53
|
+
const post = ensureArray(admin?.posts).filter(
|
|
54
|
+
(p) => p.type === POST_TYPES.POST
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ jsx(AccordionContainer, { children: /* @__PURE__ */ jsx(
|
|
57
|
+
Accordion,
|
|
58
|
+
{
|
|
59
|
+
hasBorder: true,
|
|
60
|
+
accordionHeaderProps: {
|
|
61
|
+
count: post.length,
|
|
62
|
+
isRelated: true,
|
|
63
|
+
children: t("resources.post.text")
|
|
64
|
+
},
|
|
65
|
+
children: /* @__PURE__ */ jsx(
|
|
66
|
+
PostList,
|
|
67
|
+
{
|
|
68
|
+
postIds: post.map((p) => p.id),
|
|
69
|
+
openNewTab: true,
|
|
70
|
+
type: null,
|
|
71
|
+
usableFields
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { createAdminRelationsSection };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import { File } from 'lucide-react';
|
|
5
|
+
import { PATHS } from '../../../../../constants/paths/index.js';
|
|
6
|
+
import '../../../../../constants/redirect-paths.js';
|
|
7
|
+
import 'mime-types';
|
|
8
|
+
import { findTranslation } from '../../../../../shared/translation/find-translation.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'ua-parser-js';
|
|
11
|
+
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
12
|
+
import 'next/navigation';
|
|
13
|
+
import '@radix-ui/react-avatar';
|
|
14
|
+
import '../../shadcn/badge.js';
|
|
15
|
+
import '../../shadcn/button.js';
|
|
16
|
+
import '@radix-ui/react-collapsible';
|
|
17
|
+
import '@radix-ui/react-dialog';
|
|
18
|
+
import '@radix-ui/react-dropdown-menu';
|
|
19
|
+
import '../../shadcn/input-group.js';
|
|
20
|
+
import '../../shadcn/item.js';
|
|
21
|
+
import '@radix-ui/react-label';
|
|
22
|
+
import '@radix-ui/react-select';
|
|
23
|
+
import '@radix-ui/react-separator';
|
|
24
|
+
import '../../shadcn/sidebar.js';
|
|
25
|
+
import 'next-themes';
|
|
26
|
+
import 'sonner';
|
|
27
|
+
import '@radix-ui/react-tabs';
|
|
28
|
+
import '@radix-ui/react-tooltip';
|
|
29
|
+
import { ResourceCard } from '../../ui/cards/resource-card/resource-card.js';
|
|
30
|
+
import 'next/link';
|
|
31
|
+
import '../../../../../domain/resources/admin/constants.js';
|
|
32
|
+
import 'next/image';
|
|
33
|
+
import { PostStatusBarIcons } from '../post/post-status-bar-icons.js';
|
|
34
|
+
|
|
35
|
+
function CategoryCard({
|
|
36
|
+
category,
|
|
37
|
+
// link
|
|
38
|
+
openNewTab = false,
|
|
39
|
+
anchorProps,
|
|
40
|
+
// base
|
|
41
|
+
className = ""
|
|
42
|
+
}) {
|
|
43
|
+
const { t, locale } = useTranslator();
|
|
44
|
+
const topic = category?.topic;
|
|
45
|
+
const topicTitle = findTranslation(topic?.translations, locale)?.title ?? "";
|
|
46
|
+
const title = findTranslation(category?.translations, locale)?.title ?? "";
|
|
47
|
+
const { isActive, isSlugActive, index } = category || {};
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
ResourceCard,
|
|
50
|
+
{
|
|
51
|
+
className: cn("w-72!", className),
|
|
52
|
+
href: `${PATHS.resources.category.path(topic?.slug)}/${category?.id}`,
|
|
53
|
+
openNewTab,
|
|
54
|
+
anchorProps,
|
|
55
|
+
cardStatusBarProps: {
|
|
56
|
+
badge: topicTitle,
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
PostStatusBarIcons,
|
|
59
|
+
{
|
|
60
|
+
isActive,
|
|
61
|
+
isSlugActive,
|
|
62
|
+
index
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
},
|
|
66
|
+
cardTextContentProps: {
|
|
67
|
+
title,
|
|
68
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(File, { className: "size-4" }),
|
|
70
|
+
/* @__PURE__ */ jsxs("p", { className: "truncate", children: [
|
|
71
|
+
":\xA0",
|
|
72
|
+
category && "children" in category ? category.children.length : /* @__PURE__ */ jsx("span", { className: "text-xs opacity-50", children: t("resources.see-in-details.text") })
|
|
73
|
+
] })
|
|
74
|
+
] })
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { CategoryCard };
|