@djangocfg/nextjs 1.0.3 → 1.0.5
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/README.md +59 -115
- package/package.json +24 -35
- package/src/config/base-next-config.ts +1 -0
- package/src/contact/submit.ts +24 -4
- package/src/index.ts +0 -9
- package/src/scripts/check-links.ts +477 -0
- package/src/scripts/index.ts +6 -0
- package/src/components/HomePage.tsx +0 -73
- package/src/components/index.ts +0 -7
- package/src/errors/ErrorLayout.tsx +0 -228
- package/src/errors/errorConfig.ts +0 -118
- package/src/errors/index.ts +0 -10
- package/src/legal/LegalPage.tsx +0 -85
- package/src/legal/configs.ts +0 -131
- package/src/legal/index.ts +0 -24
- package/src/legal/pages.tsx +0 -58
- package/src/legal/types.ts +0 -15
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ErrorLayout - Universal Error Display
|
|
3
|
-
*
|
|
4
|
-
* Minimalist error page with customizable content
|
|
5
|
-
* Works with Next.js error pages (404.tsx, 500.tsx, error.tsx)
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // app/not-found.tsx
|
|
10
|
-
* import { ErrorLayout } from '@djangocfg/nextjs/errors';
|
|
11
|
-
*
|
|
12
|
-
* export default function NotFound() {
|
|
13
|
-
* return <ErrorLayout code={404} supportEmail={settings.contact.email} />;
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
'use client';
|
|
19
|
-
|
|
20
|
-
import React from 'react';
|
|
21
|
-
import { Button } from '@djangocfg/ui/components';
|
|
22
|
-
import { getErrorContent } from './errorConfig';
|
|
23
|
-
|
|
24
|
-
export interface ErrorLayoutProps {
|
|
25
|
-
/** Error code (e.g., "404", "500", "403") - if provided, auto-configures title/description/icon */
|
|
26
|
-
code?: string | number;
|
|
27
|
-
/** Error title (auto-generated from code if not provided) */
|
|
28
|
-
title?: string;
|
|
29
|
-
/** Error description (auto-generated from code if not provided) */
|
|
30
|
-
description?: string;
|
|
31
|
-
/** Custom action buttons */
|
|
32
|
-
actions?: React.ReactNode;
|
|
33
|
-
/** Show default actions (back, home) */
|
|
34
|
-
showDefaultActions?: boolean;
|
|
35
|
-
/** Custom illustration/icon (auto-generated from code if not provided) */
|
|
36
|
-
illustration?: React.ReactNode;
|
|
37
|
-
/** Support email for contact link */
|
|
38
|
-
supportEmail?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Local function to select the icon based on the code.
|
|
42
|
-
// This is safe as it's defined and used inside a Client Component.
|
|
43
|
-
function getErrorIcon(code?: string | number): React.ReactNode {
|
|
44
|
-
const c = code ? String(code) : '';
|
|
45
|
-
|
|
46
|
-
// NOTE: You can replace these SVG paths with imported Lucid Icons
|
|
47
|
-
// (e.g., <AlertTriangle />) if you prefer.
|
|
48
|
-
switch (c) {
|
|
49
|
-
case '404':
|
|
50
|
-
return (
|
|
51
|
-
<svg
|
|
52
|
-
className="w-24 h-24 mx-auto text-muted-foreground/50"
|
|
53
|
-
fill="none"
|
|
54
|
-
stroke="currentColor"
|
|
55
|
-
viewBox="0 0 24 24"
|
|
56
|
-
aria-hidden="true"
|
|
57
|
-
>
|
|
58
|
-
{/* Missing Page Icon */}
|
|
59
|
-
<path
|
|
60
|
-
strokeLinecap="round"
|
|
61
|
-
strokeLinejoin="round"
|
|
62
|
-
strokeWidth={1.5}
|
|
63
|
-
d="M9.343 3.07a7.227 7.227 0 0111.558 0c.806.515 1.393 1.39 1.393 2.37v6.636c0 .98-.587 1.855-1.393 2.37a7.227 7.227 0 01-11.558 0c-.806-.515-1.393-1.39-1.393-2.37V5.44c0-.98.587-1.855 1.393-2.37zM12 13a1 1 0 100-2 1 1 0 000 2z"
|
|
64
|
-
/>
|
|
65
|
-
</svg>
|
|
66
|
-
);
|
|
67
|
-
case '500':
|
|
68
|
-
return (
|
|
69
|
-
<svg
|
|
70
|
-
className="w-24 h-24 mx-auto text-muted-foreground/50"
|
|
71
|
-
fill="none"
|
|
72
|
-
stroke="currentColor"
|
|
73
|
-
viewBox="0 0 24 24"
|
|
74
|
-
aria-hidden="true"
|
|
75
|
-
>
|
|
76
|
-
{/* Server Error Icon */}
|
|
77
|
-
<path
|
|
78
|
-
strokeLinecap="round"
|
|
79
|
-
strokeLinejoin="round"
|
|
80
|
-
strokeWidth={1.5}
|
|
81
|
-
d="M18.364 18.364A9 9 0 005.636 5.636m12.728 0l-6.849 6.849m0 0l-6.849-6.849m6.849 6.849V21m0 0h7.5M12 21v-7.5M7.5 21H3m7.5 0h7.5M3 18V9a4.5 4.5 0 014.5-4.5h9A4.5 4.5 0 0121 9v9a4.5 4.5 0 01-4.5 4.5h-9A4.5 4.5 0 013 18z"
|
|
82
|
-
/>
|
|
83
|
-
</svg>
|
|
84
|
-
);
|
|
85
|
-
case '403':
|
|
86
|
-
return (
|
|
87
|
-
<svg
|
|
88
|
-
className="w-24 h-24 mx-auto text-muted-foreground/50"
|
|
89
|
-
fill="none"
|
|
90
|
-
stroke="currentColor"
|
|
91
|
-
viewBox="0 0 24 24"
|
|
92
|
-
aria-hidden="true"
|
|
93
|
-
>
|
|
94
|
-
{/* Forbidden Icon */}
|
|
95
|
-
<path
|
|
96
|
-
strokeLinecap="round"
|
|
97
|
-
strokeLinejoin="round"
|
|
98
|
-
strokeWidth={1.5}
|
|
99
|
-
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
|
|
100
|
-
/>
|
|
101
|
-
</svg>
|
|
102
|
-
);
|
|
103
|
-
default:
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* ErrorLayout Component
|
|
110
|
-
*/
|
|
111
|
-
export function ErrorLayout({
|
|
112
|
-
code,
|
|
113
|
-
title,
|
|
114
|
-
description,
|
|
115
|
-
actions,
|
|
116
|
-
showDefaultActions = true,
|
|
117
|
-
illustration,
|
|
118
|
-
supportEmail = 'support@example.com',
|
|
119
|
-
}: ErrorLayoutProps) {
|
|
120
|
-
|
|
121
|
-
// Get content (Title/Description) from config. Note: Illustration check removed.
|
|
122
|
-
// The function getErrorContent MUST NOT return React components/functions.
|
|
123
|
-
const autoContent = code && (!title || !description)
|
|
124
|
-
? getErrorContent(code)
|
|
125
|
-
: null;
|
|
126
|
-
|
|
127
|
-
// Fallback to auto-generated values
|
|
128
|
-
const finalTitle = title || autoContent?.title || 'Error';
|
|
129
|
-
const finalDescription = description || autoContent?.description;
|
|
130
|
-
|
|
131
|
-
// ILLUSTRATION FIX: Use passed prop OR compute the icon locally using getErrorIcon.
|
|
132
|
-
const finalIllustration = illustration ?? getErrorIcon(code);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const handleGoBack = () => {
|
|
136
|
-
if (document.referrer && document.referrer !== window.location.href) {
|
|
137
|
-
window.location.href = document.referrer;
|
|
138
|
-
} else if (window.history.length > 1) {
|
|
139
|
-
window.history.back();
|
|
140
|
-
} else {
|
|
141
|
-
window.location.href = '/';
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const handleGoHome = () => {
|
|
146
|
-
window.location.href = '/';
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<div className="min-h-screen flex items-center justify-center px-4 bg-background">
|
|
151
|
-
<div className="max-w-2xl w-full text-center space-y-8">
|
|
152
|
-
{/* Error Code */}
|
|
153
|
-
{code && (
|
|
154
|
-
<div className="relative">
|
|
155
|
-
<h1
|
|
156
|
-
className="text-[12rem] font-bold leading-none text-muted/20 select-none"
|
|
157
|
-
aria-hidden="true"
|
|
158
|
-
>
|
|
159
|
-
{code}
|
|
160
|
-
</h1>
|
|
161
|
-
</div>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{/* Illustration */}
|
|
165
|
-
{finalIllustration && (
|
|
166
|
-
<div className="flex justify-center py-8">
|
|
167
|
-
{finalIllustration}
|
|
168
|
-
</div>
|
|
169
|
-
)}
|
|
170
|
-
|
|
171
|
-
{/* Error Content */}
|
|
172
|
-
<div className="space-y-4">
|
|
173
|
-
<h2 className="text-4xl font-bold text-foreground">
|
|
174
|
-
{finalTitle}
|
|
175
|
-
</h2>
|
|
176
|
-
|
|
177
|
-
{finalDescription && (
|
|
178
|
-
<p className="text-lg text-muted-foreground max-w-md mx-auto">
|
|
179
|
-
{finalDescription}
|
|
180
|
-
</p>
|
|
181
|
-
)}
|
|
182
|
-
</div>
|
|
183
|
-
|
|
184
|
-
{/* Actions */}
|
|
185
|
-
<div className="flex flex-col sm:flex-row items-center justify-center gap-4 pt-4">
|
|
186
|
-
{/* Custom actions */}
|
|
187
|
-
{actions}
|
|
188
|
-
|
|
189
|
-
{/* Default actions */}
|
|
190
|
-
{showDefaultActions && !actions && (
|
|
191
|
-
<>
|
|
192
|
-
<Button
|
|
193
|
-
variant="outline"
|
|
194
|
-
size="lg"
|
|
195
|
-
onClick={handleGoBack}
|
|
196
|
-
style={{ minWidth: '140px', padding: '12px 32px' }}
|
|
197
|
-
>
|
|
198
|
-
Go Back
|
|
199
|
-
</Button>
|
|
200
|
-
<Button
|
|
201
|
-
variant="default"
|
|
202
|
-
size="lg"
|
|
203
|
-
onClick={handleGoHome}
|
|
204
|
-
style={{ minWidth: '140px', padding: '12px 32px' }}
|
|
205
|
-
>
|
|
206
|
-
Go Home
|
|
207
|
-
</Button>
|
|
208
|
-
</>
|
|
209
|
-
)}
|
|
210
|
-
</div>
|
|
211
|
-
|
|
212
|
-
{/* Additional Info */}
|
|
213
|
-
<div className="pt-8 text-sm text-muted-foreground">
|
|
214
|
-
<p>
|
|
215
|
-
Need help? Contact{' '}
|
|
216
|
-
<a
|
|
217
|
-
href={`mailto:${supportEmail}`}
|
|
218
|
-
className="text-primary hover:underline"
|
|
219
|
-
>
|
|
220
|
-
support
|
|
221
|
-
</a>
|
|
222
|
-
</p>
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Universal Error Configuration
|
|
3
|
-
*
|
|
4
|
-
* Provides standard error content for common HTTP status codes
|
|
5
|
-
* Use this to maintain consistency across error pages
|
|
6
|
-
*
|
|
7
|
-
* NOTE: Only returns primitives (title, description) - NO React components
|
|
8
|
-
* This ensures safe serialization during prerendering
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export interface ErrorContent {
|
|
12
|
-
title: string;
|
|
13
|
-
description: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Get standardized error content based on status code
|
|
18
|
-
*
|
|
19
|
-
* @param statusCode - HTTP status code or custom error type
|
|
20
|
-
* @returns Error content configuration (title and description only)
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* const { title, description } = getErrorContent(404);
|
|
25
|
-
* <ErrorLayout title={title} description={description} code={404} />
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export function getErrorContent(statusCode?: number | string): ErrorContent {
|
|
29
|
-
const code = typeof statusCode === 'string' ? parseInt(statusCode, 10) : statusCode;
|
|
30
|
-
|
|
31
|
-
switch (code) {
|
|
32
|
-
// 400 Bad Request
|
|
33
|
-
case 400:
|
|
34
|
-
return {
|
|
35
|
-
title: 'Bad Request',
|
|
36
|
-
description: 'The request could not be understood. Please check your input and try again.',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// 401 Unauthorized
|
|
40
|
-
case 401:
|
|
41
|
-
return {
|
|
42
|
-
title: 'Authentication Required',
|
|
43
|
-
description: 'You need to sign in to access this page.',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// 403 Forbidden
|
|
47
|
-
case 403:
|
|
48
|
-
return {
|
|
49
|
-
title: 'Access Denied',
|
|
50
|
-
description: "You don't have permission to access this resource.",
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// 404 Not Found
|
|
54
|
-
case 404:
|
|
55
|
-
return {
|
|
56
|
-
title: 'Page Not Found',
|
|
57
|
-
description: "The page you're looking for doesn't exist or has been moved.",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// 408 Request Timeout
|
|
61
|
-
case 408:
|
|
62
|
-
return {
|
|
63
|
-
title: 'Request Timeout',
|
|
64
|
-
description: 'The request took too long to process. Please try again.',
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// 500 Internal Server Error
|
|
68
|
-
case 500:
|
|
69
|
-
return {
|
|
70
|
-
title: 'Server Error',
|
|
71
|
-
description: "Something went wrong on our end. We're working to fix it.",
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// 502 Bad Gateway
|
|
75
|
-
case 502:
|
|
76
|
-
return {
|
|
77
|
-
title: 'Bad Gateway',
|
|
78
|
-
description: 'The server received an invalid response. Please try again later.',
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// 503 Service Unavailable
|
|
82
|
-
case 503:
|
|
83
|
-
return {
|
|
84
|
-
title: 'Service Unavailable',
|
|
85
|
-
description: 'The service is temporarily unavailable. Please try again later.',
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// 504 Gateway Timeout
|
|
89
|
-
case 504:
|
|
90
|
-
return {
|
|
91
|
-
title: 'Gateway Timeout',
|
|
92
|
-
description: 'The server took too long to respond. Please try again.',
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// Default / Unknown Error
|
|
96
|
-
default:
|
|
97
|
-
return {
|
|
98
|
-
title: 'Something Went Wrong',
|
|
99
|
-
description: 'An unexpected error occurred. Please try again or contact support.',
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Common error codes as constants
|
|
106
|
-
*/
|
|
107
|
-
export const ERROR_CODES = {
|
|
108
|
-
BAD_REQUEST: 400,
|
|
109
|
-
UNAUTHORIZED: 401,
|
|
110
|
-
FORBIDDEN: 403,
|
|
111
|
-
NOT_FOUND: 404,
|
|
112
|
-
TIMEOUT: 408,
|
|
113
|
-
SERVER_ERROR: 500,
|
|
114
|
-
BAD_GATEWAY: 502,
|
|
115
|
-
SERVICE_UNAVAILABLE: 503,
|
|
116
|
-
GATEWAY_TIMEOUT: 504,
|
|
117
|
-
} as const;
|
|
118
|
-
|
package/src/errors/index.ts
DELETED
package/src/legal/LegalPage.tsx
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LegalPage Component
|
|
3
|
-
*
|
|
4
|
-
* Reusable component for legal pages (Privacy, Terms, Cookies, Security)
|
|
5
|
-
* Accepts configuration for flexible content rendering
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* import { LegalPage } from '@djangocfg/nextjs/legal';
|
|
10
|
-
* import { privacyConfig } from './config';
|
|
11
|
-
*
|
|
12
|
-
* export default function PrivacyPage() {
|
|
13
|
-
* return <LegalPage config={privacyConfig} />;
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
'use client';
|
|
19
|
-
|
|
20
|
-
import React from 'react';
|
|
21
|
-
import {
|
|
22
|
-
Card,
|
|
23
|
-
CardHeader,
|
|
24
|
-
CardTitle,
|
|
25
|
-
CardContent,
|
|
26
|
-
} from '@djangocfg/ui/components';
|
|
27
|
-
import type { LegalPageConfig } from './types';
|
|
28
|
-
|
|
29
|
-
export interface LegalPageProps {
|
|
30
|
-
config: LegalPageConfig;
|
|
31
|
-
className?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Format date for display
|
|
36
|
-
*/
|
|
37
|
-
function formatDate(date: string | Date | undefined): string {
|
|
38
|
-
if (!date) return '';
|
|
39
|
-
if (typeof date === 'string') return date;
|
|
40
|
-
return date.toISOString().split('T')[0];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* LegalPage Component
|
|
45
|
-
*/
|
|
46
|
-
export function LegalPage({ config, className }: LegalPageProps) {
|
|
47
|
-
const { title, lastUpdated, sections } = config;
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className={`container mx-auto max-w-4xl py-16 px-4 ${className || ''}`}>
|
|
51
|
-
<div className="flex flex-col gap-8">
|
|
52
|
-
{/* Header */}
|
|
53
|
-
<div className="flex flex-col gap-4">
|
|
54
|
-
<h1 className="text-4xl font-bold">{title}</h1>
|
|
55
|
-
{lastUpdated && (
|
|
56
|
-
<p className="text-lg text-muted-foreground">
|
|
57
|
-
Last updated: {formatDate(lastUpdated)}
|
|
58
|
-
</p>
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
{/* Sections */}
|
|
63
|
-
{sections.map((section, index) => (
|
|
64
|
-
<Card key={index}>
|
|
65
|
-
<CardHeader>
|
|
66
|
-
<CardTitle>{section.title}</CardTitle>
|
|
67
|
-
</CardHeader>
|
|
68
|
-
<CardContent className="text-muted-foreground">
|
|
69
|
-
{Array.isArray(section.content) ? (
|
|
70
|
-
<div className="flex flex-col gap-2">
|
|
71
|
-
{section.content.map((paragraph, pIndex) => (
|
|
72
|
-
<p key={pIndex}>{paragraph}</p>
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
) : (
|
|
76
|
-
<p>{section.content}</p>
|
|
77
|
-
)}
|
|
78
|
-
</CardContent>
|
|
79
|
-
</Card>
|
|
80
|
-
))}
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
package/src/legal/configs.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default legal page configurations
|
|
3
|
-
*
|
|
4
|
-
* Pre-configured content for common legal pages
|
|
5
|
-
* Can be customized or extended as needed
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { LegalPageConfig } from './types';
|
|
9
|
-
|
|
10
|
-
export const privacyConfig: LegalPageConfig = {
|
|
11
|
-
title: 'Privacy Policy',
|
|
12
|
-
sections: [
|
|
13
|
-
{
|
|
14
|
-
title: 'Information We Collect',
|
|
15
|
-
content: 'We collect information that you provide directly to us, including when you create an account, use our services, or communicate with us.',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
title: 'How We Use Your Information',
|
|
19
|
-
content: [
|
|
20
|
-
'We use the information we collect to:',
|
|
21
|
-
'Provide, maintain, and improve our services',
|
|
22
|
-
'Process transactions and send related information',
|
|
23
|
-
'Send technical notices and support messages',
|
|
24
|
-
'Respond to your comments and questions',
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
title: 'Information Sharing',
|
|
29
|
-
content: 'We do not share your personal information with third parties except as described in this privacy policy or with your consent.',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: 'Data Security',
|
|
33
|
-
content: 'We take reasonable measures to help protect your personal information from loss, theft, misuse, unauthorized access, disclosure, alteration, and destruction.',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
title: 'Your Rights',
|
|
37
|
-
content: 'You have the right to access, update, or delete your personal information at any time. Contact us if you wish to exercise these rights.',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
title: 'Changes to This Policy',
|
|
41
|
-
content: 'We may update this privacy policy from time to time. We will notify you of any changes by posting the new policy on this page.',
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const termsConfig: LegalPageConfig = {
|
|
47
|
-
title: 'Terms of Service',
|
|
48
|
-
sections: [
|
|
49
|
-
{
|
|
50
|
-
title: '1. Acceptance of Terms',
|
|
51
|
-
content: 'By accessing and using this service, you accept and agree to be bound by the terms and provision of this agreement.',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: '2. Use License',
|
|
55
|
-
content: 'Permission is granted to temporarily download one copy of the materials on our service for personal, non-commercial transitory viewing only.',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: '3. Disclaimer',
|
|
59
|
-
content: 'The materials on our service are provided on an \'as is\' basis. We make no warranties, expressed or implied, and hereby disclaim and negate all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights.',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: '4. Limitations',
|
|
63
|
-
content: 'In no event shall we or our suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on our service.',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: '5. Revisions',
|
|
67
|
-
content: 'We may revise these terms of service at any time without notice. By using this service you are agreeing to be bound by the then current version of these terms of service.',
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const cookiesConfig: LegalPageConfig = {
|
|
73
|
-
title: 'Cookie Policy',
|
|
74
|
-
sections: [
|
|
75
|
-
{
|
|
76
|
-
title: 'What Are Cookies?',
|
|
77
|
-
content: 'Cookies are small text files that are placed on your device when you visit our website. They help us provide you with a better experience by remembering your preferences and understanding how you use our site.',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
title: 'Types of Cookies We Use',
|
|
81
|
-
content: [
|
|
82
|
-
'Essential Cookies: These cookies are necessary for the website to function properly.',
|
|
83
|
-
'Performance Cookies: These cookies help us understand how visitors interact with our website.',
|
|
84
|
-
'Functionality Cookies: These cookies allow us to remember choices you make and provide enhanced features.',
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
title: 'Managing Cookies',
|
|
89
|
-
content: 'Most web browsers allow you to control cookies through their settings. You can set your browser to refuse cookies or delete certain cookies. However, please note that if you disable cookies, some features of our website may not function properly.',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
title: 'Third-Party Cookies',
|
|
93
|
-
content: 'We may use third-party services that also use cookies. These third parties have their own privacy policies, and we do not accept any responsibility or liability for their policies.',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
title: 'Updates to This Policy',
|
|
97
|
-
content: 'We may update our Cookie Policy from time to time. Any changes will be posted on this page with an updated revision date.',
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const securityConfig: LegalPageConfig = {
|
|
103
|
-
title: 'Security Policy',
|
|
104
|
-
sections: [
|
|
105
|
-
{
|
|
106
|
-
title: 'Our Commitment to Security',
|
|
107
|
-
content: 'We take the security of your data seriously. We implement industry-standard security measures to protect your personal information from unauthorized access, disclosure, alteration, and destruction.',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
title: 'Data Encryption',
|
|
111
|
-
content: 'All data transmitted between your device and our servers is encrypted using industry-standard SSL/TLS protocols. Sensitive data stored in our databases is encrypted at rest using advanced encryption standards.',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
title: 'Access Controls',
|
|
115
|
-
content: 'Access to user data is strictly limited to authorized personnel who require it to perform their job functions. We employ multi-factor authentication and regular access reviews to ensure that only authorized individuals can access sensitive information.',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
title: 'Security Monitoring',
|
|
119
|
-
content: 'We continuously monitor our systems for potential security threats and vulnerabilities. Our security team actively tracks and responds to any suspicious activity or potential security incidents.',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
title: 'Reporting Security Issues',
|
|
123
|
-
content: 'If you discover a security vulnerability or have concerns about our security practices, please report it to us immediately. We appreciate responsible disclosure and will work with you to address any legitimate security concerns.',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
title: 'Regular Security Updates',
|
|
127
|
-
content: 'We regularly update our systems and software to ensure that known security vulnerabilities are patched promptly. Our infrastructure undergoes periodic security audits and penetration testing to identify and address potential weaknesses.',
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
};
|
|
131
|
-
|
package/src/legal/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legal pages exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export { LegalPage } from './LegalPage';
|
|
6
|
-
export type { LegalPageProps } from './LegalPage';
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
PrivacyPage,
|
|
10
|
-
TermsPage,
|
|
11
|
-
CookiesPage,
|
|
12
|
-
SecurityPage,
|
|
13
|
-
} from './pages';
|
|
14
|
-
export type { LegalPageComponentProps } from './pages';
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
privacyConfig,
|
|
18
|
-
termsConfig,
|
|
19
|
-
cookiesConfig,
|
|
20
|
-
securityConfig,
|
|
21
|
-
} from './configs';
|
|
22
|
-
|
|
23
|
-
export type { LegalPageConfig, LegalPageSection } from './types';
|
|
24
|
-
|
package/src/legal/pages.tsx
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pre-built legal page components
|
|
3
|
-
*
|
|
4
|
-
* Ready-to-use page components with default configurations
|
|
5
|
-
* Can be customized by passing custom config
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // app/legal/privacy/page.tsx
|
|
10
|
-
* import { PrivacyPage } from '@djangocfg/nextjs/legal';
|
|
11
|
-
*
|
|
12
|
-
* export default PrivacyPage;
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
'use client';
|
|
17
|
-
|
|
18
|
-
import { LegalPage } from './LegalPage';
|
|
19
|
-
import {
|
|
20
|
-
privacyConfig,
|
|
21
|
-
termsConfig,
|
|
22
|
-
cookiesConfig,
|
|
23
|
-
securityConfig,
|
|
24
|
-
} from './configs';
|
|
25
|
-
import type { LegalPageConfig } from './types';
|
|
26
|
-
|
|
27
|
-
export interface LegalPageComponentProps {
|
|
28
|
-
config?: LegalPageConfig;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Privacy Policy Page
|
|
33
|
-
*/
|
|
34
|
-
export function PrivacyPage({ config }: LegalPageComponentProps = {}) {
|
|
35
|
-
return <LegalPage config={config || privacyConfig} />;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Terms of Service Page
|
|
40
|
-
*/
|
|
41
|
-
export function TermsPage({ config }: LegalPageComponentProps = {}) {
|
|
42
|
-
return <LegalPage config={config || termsConfig} />;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Cookie Policy Page
|
|
47
|
-
*/
|
|
48
|
-
export function CookiesPage({ config }: LegalPageComponentProps = {}) {
|
|
49
|
-
return <LegalPage config={config || cookiesConfig} />;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Security Policy Page
|
|
54
|
-
*/
|
|
55
|
-
export function SecurityPage({ config }: LegalPageComponentProps = {}) {
|
|
56
|
-
return <LegalPage config={config || securityConfig} />;
|
|
57
|
-
}
|
|
58
|
-
|
package/src/legal/types.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legal page types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export interface LegalPageSection {
|
|
6
|
-
title: string;
|
|
7
|
-
content: string | string[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface LegalPageConfig {
|
|
11
|
-
title: string;
|
|
12
|
-
lastUpdated?: string | Date;
|
|
13
|
-
sections: LegalPageSection[];
|
|
14
|
-
}
|
|
15
|
-
|