Add Legal Office seal and complete Azure CDN deployment
- Add Legal Office of the Master seal (SVG design with Maltese Cross, scales of justice, legal scroll) - Create legal-office-manifest-template.json for Legal Office credentials - Update SEAL_MAPPING.md and DESIGN_GUIDE.md with Legal Office seal documentation - Complete Azure CDN infrastructure deployment: - Resource group, storage account, and container created - 17 PNG seal files uploaded to Azure Blob Storage - All manifest templates updated with Azure URLs - Configuration files generated (azure-cdn-config.env) - Add comprehensive Azure CDN setup scripts and documentation - Fix manifest URL generation to prevent double slashes - Verify all seals accessible via HTTPS
This commit is contained in:
@@ -12,7 +12,7 @@ const server = new Server({
|
||||
});
|
||||
|
||||
// Initialize server
|
||||
async function main() {
|
||||
async function main(): Promise<void> {
|
||||
const transport = new StdioServerTransport();
|
||||
await server.connect(transport);
|
||||
console.error('MCP Legal server running on stdio');
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Select, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function AuditPage() {
|
||||
export default function AuditPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
const [filters, setFilters] = useState({
|
||||
action: '',
|
||||
@@ -15,19 +15,20 @@ export default function AuditPage() {
|
||||
pageSize: 50,
|
||||
});
|
||||
|
||||
const { data: auditLogs, isLoading, error } = useQuery({
|
||||
const { data: auditLogs, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.identity.searchAuditLogs>>>({
|
||||
queryKey: ['audit-logs', filters],
|
||||
queryFn: () =>
|
||||
apiClient.identity.searchAuditLogs({
|
||||
queryFn: async () => {
|
||||
return await apiClient.identity.searchAuditLogs({
|
||||
action: filters.action as 'issued' | 'revoked' | 'verified' | 'renewed' | undefined,
|
||||
credentialId: filters.credentialId || undefined,
|
||||
subjectDid: filters.subjectDid || undefined,
|
||||
page: filters.page,
|
||||
pageSize: filters.pageSize,
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const getActionBadge = (action: string) => {
|
||||
const getActionBadge = (action: string): JSX.Element => {
|
||||
switch (action) {
|
||||
case 'issued':
|
||||
return <Badge variant="success">Issued</Badge>;
|
||||
@@ -142,20 +143,20 @@ export default function AuditPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{auditLogs.logs.map((log: any) => (
|
||||
<TableRow key={log.id || `${log.credential_id}-${log.performed_at}`}>
|
||||
{auditLogs.logs.map((log: { id: string; action: string; credentialId?: string; subjectDid?: string; performedBy?: string; timestamp: string; metadata?: Record<string, unknown> }) => (
|
||||
<TableRow key={log.id || `${log.credentialId || 'unknown'}-${log.timestamp}`}>
|
||||
<TableCell>
|
||||
{log.performed_at
|
||||
? new Date(log.performed_at).toLocaleString()
|
||||
{log.timestamp
|
||||
? new Date(log.timestamp).toLocaleString()
|
||||
: 'N/A'}
|
||||
</TableCell>
|
||||
<TableCell>{getActionBadge(log.action || 'unknown')}</TableCell>
|
||||
<TableCell className="font-mono text-sm">
|
||||
{log.credential_id || 'N/A'}
|
||||
{log.credentialId || 'N/A'}
|
||||
</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.subject_did || 'N/A'}</TableCell>
|
||||
<TableCell>{log.performed_by || 'System'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.ip_address || 'N/A'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.subjectDid || 'N/A'}</TableCell>
|
||||
<TableCell>{log.performedBy || 'System'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.metadata?.ipAddress as string || 'N/A'}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function IssueCredentialPage() {
|
||||
export default function IssueCredentialPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const apiClient = getApiClient();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -36,7 +36,7 @@ export default function IssueCredentialPage() {
|
||||
notes: '',
|
||||
});
|
||||
|
||||
const mutation = useMutation({
|
||||
const mutation = useMutation<Awaited<ReturnType<typeof apiClient.identity.issueCredential>>, Error, typeof formData>({
|
||||
mutationFn: async (data: typeof formData) => {
|
||||
const credentialSubject: Record<string, unknown> = {
|
||||
givenName: data.givenName,
|
||||
@@ -51,7 +51,7 @@ export default function IssueCredentialPage() {
|
||||
credentialSubject.nationality = data.nationality;
|
||||
}
|
||||
|
||||
return apiClient.identity.issueCredential({
|
||||
return await apiClient.identity.issueCredential({
|
||||
subject: data.subjectDid,
|
||||
credentialSubject,
|
||||
expirationDate: data.expirationDate || undefined,
|
||||
@@ -69,7 +69,7 @@ export default function IssueCredentialPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>): void => {
|
||||
e.preventDefault();
|
||||
if (!formData.subjectDid.trim()) {
|
||||
showError('Subject DID is required', 'Validation Error');
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function CredentialsPage() {
|
||||
export default function CredentialsPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const apiClient = getApiClient();
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
@@ -22,9 +22,9 @@ export default function CredentialsPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const filteredData = metrics?.filter((item) =>
|
||||
const filteredData = metrics?.filter((item: { credentialId: string; credentialType: string[] }) =>
|
||||
item.credentialId.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
item.credentialType.some((type) => type.toLowerCase().includes(searchTerm.toLowerCase()))
|
||||
item.credentialType.some((type: string) => type.toLowerCase().includes(searchTerm.toLowerCase()))
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -74,12 +74,12 @@ export default function CredentialsPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{filteredData.map((credential) => (
|
||||
{filteredData.map((credential: { credentialId: string; credentialType: string[]; issuedAt: Date; subjectDid: string }) => (
|
||||
<TableRow key={credential.credentialId}>
|
||||
<TableCell className="font-mono text-sm">{credential.credentialId}</TableCell>
|
||||
<TableCell>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{credential.credentialType.map((type) => (
|
||||
{credential.credentialType.map((type: string) => (
|
||||
<Badge key={type} variant="secondary">
|
||||
{type}
|
||||
</Badge>
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="flex flex-col min-h-screen">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import { useToast } from '@the-order/ui';
|
||||
|
||||
export default function LoginPage() {
|
||||
export default function LoginPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { login } = useAuth();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -17,7 +17,7 @@ export default function LoginPage() {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [loginError, setLoginError] = useState<string | null>(null);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>): Promise<void> => {
|
||||
e.preventDefault();
|
||||
setIsLoading(true);
|
||||
setLoginError(null);
|
||||
@@ -62,7 +62,7 @@ export default function LoginPage() {
|
||||
<CardDescription>Sign in to the internal portal</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<form onSubmit={(e) => { void handleSubmit(e); }} className="space-y-4">
|
||||
{loginError && (
|
||||
<Alert variant="destructive">
|
||||
<AlertDescription>{loginError}</AlertDescription>
|
||||
|
||||
@@ -4,12 +4,14 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Badge, Skeleton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function MetricsPage() {
|
||||
export default function MetricsPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
|
||||
const { data: dashboard, isLoading, error } = useQuery({
|
||||
const { data: dashboard, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.identity.getMetricsDashboard>>>({
|
||||
queryKey: ['metrics-dashboard'],
|
||||
queryFn: () => apiClient.identity.getMetricsDashboard(),
|
||||
queryFn: async () => {
|
||||
return await apiClient.identity.getMetricsDashboard();
|
||||
},
|
||||
});
|
||||
|
||||
if (isLoading) {
|
||||
@@ -96,7 +98,7 @@ export default function MetricsPage() {
|
||||
<CardTitle className="text-sm font-medium text-gray-500">Success Rate</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-3xl font-bold">{summary?.successRate.toFixed(1) || 0}%</div>
|
||||
<div className="text-3xl font-bold">{summary?.successRate ? summary.successRate.toFixed(1) : 0}%</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -118,7 +120,7 @@ export default function MetricsPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{dashboard.topCredentialTypes.map((item) => (
|
||||
{dashboard.topCredentialTypes.map((item: { type: string; count: number; percentage: number }) => (
|
||||
<TableRow key={item.type}>
|
||||
<TableCell>{item.type}</TableCell>
|
||||
<TableCell>{item.count}</TableCell>
|
||||
@@ -141,7 +143,7 @@ export default function MetricsPage() {
|
||||
<CardContent>
|
||||
{summary?.recentIssuances && summary.recentIssuances.length > 0 ? (
|
||||
<div className="space-y-4">
|
||||
{summary.recentIssuances.map((issuance) => (
|
||||
{summary.recentIssuances.map((issuance: { credentialId: string; credentialType: string[]; issuedAt: Date; subjectDid: string }) => (
|
||||
<div key={issuance.credentialId} className="flex items-center justify-between border-b pb-3">
|
||||
<div>
|
||||
<p className="font-medium">{issuance.credentialType.join(', ')}</p>
|
||||
@@ -170,7 +172,7 @@ export default function MetricsPage() {
|
||||
<CardContent>
|
||||
{summary?.byCredentialType && Object.keys(summary.byCredentialType).length > 0 ? (
|
||||
<div className="space-y-2">
|
||||
{Object.entries(summary.byCredentialType).map(([type, count]) => (
|
||||
{Object.entries(summary.byCredentialType).map(([type, count]: [string, number]) => (
|
||||
<div key={type} className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium">{type}</span>
|
||||
<Badge>{count}</Badge>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function Home() {
|
||||
export default function Home(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50">
|
||||
<div className="container mx-auto px-4 py-16">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Badg
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function ReviewDetailPage() {
|
||||
export default function ReviewDetailPage(): JSX.Element {
|
||||
const params = useParams();
|
||||
const router = useRouter();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -17,14 +17,16 @@ export default function ReviewDetailPage() {
|
||||
const [reason, setReason] = useState('');
|
||||
const { success, error: showError } = useToast();
|
||||
|
||||
const { data: application, isLoading, error } = useQuery({
|
||||
const { data: application, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.eresidency.getApplicationForReview>>>({
|
||||
queryKey: ['application', applicationId],
|
||||
queryFn: () => apiClient.eresidency.getApplicationForReview(applicationId),
|
||||
queryFn: async () => {
|
||||
return await apiClient.eresidency.getApplicationForReview(applicationId);
|
||||
},
|
||||
});
|
||||
|
||||
const adjudicateMutation = useMutation({
|
||||
const adjudicateMutation = useMutation<Awaited<ReturnType<typeof apiClient.eresidency.adjudicateApplication>>, Error, { decision: 'approve' | 'reject'; reason?: string; notes?: string }>({
|
||||
mutationFn: async (data: { decision: 'approve' | 'reject'; reason?: string; notes?: string }) => {
|
||||
return apiClient.eresidency.adjudicateApplication(applicationId, data);
|
||||
return await apiClient.eresidency.adjudicateApplication(applicationId, data);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['application', applicationId] });
|
||||
@@ -75,7 +77,7 @@ export default function ReviewDetailPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const getStatusBadge = (status: string) => {
|
||||
const getStatusBadge = (status: string): JSX.Element => {
|
||||
switch (status) {
|
||||
case 'approved':
|
||||
return <Badge variant="success">Approved</Badge>;
|
||||
@@ -90,7 +92,7 @@ export default function ReviewDetailPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleAdjudicate = () => {
|
||||
const handleAdjudicate = (): void => {
|
||||
if (!decision) return;
|
||||
if (decision === 'reject' && !reason.trim()) {
|
||||
alert('Please provide a rejection reason');
|
||||
|
||||
@@ -5,12 +5,14 @@ import Link from 'next/link';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function ReviewPage() {
|
||||
export default function ReviewPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
|
||||
const { data: queue, isLoading, error } = useQuery({
|
||||
const { data: queue, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.eresidency.getReviewQueue>>>({
|
||||
queryKey: ['review-queue'],
|
||||
queryFn: () => apiClient.eresidency.getReviewQueue({ limit: 50 }),
|
||||
queryFn: async () => {
|
||||
return await apiClient.eresidency.getReviewQueue({ limit: 50 });
|
||||
},
|
||||
});
|
||||
|
||||
if (isLoading) {
|
||||
@@ -45,7 +47,7 @@ export default function ReviewPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
const getStatusColor = (status: string): string => {
|
||||
switch (status) {
|
||||
case 'under_review':
|
||||
return 'text-blue-600 bg-blue-50';
|
||||
@@ -80,7 +82,7 @@ export default function ReviewPage() {
|
||||
<p className="text-gray-600 text-center py-8">No applications in queue</p>
|
||||
) : (
|
||||
<div className="space-y-4">
|
||||
{queue.applications.map((app) => (
|
||||
{queue.applications.map((app: { id: string; givenName: string; familyName: string; email: string; submittedAt?: string; status: string; riskScore?: number }) => (
|
||||
<Link key={app.id} href={`/review/${app.id}`}>
|
||||
<Card className="hover:shadow-md transition-shadow cursor-pointer">
|
||||
<CardContent className="p-6">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Button, Switch, useToast } from '@the-order/ui';
|
||||
|
||||
export default function SettingsPage() {
|
||||
export default function SettingsPage(): JSX.Element {
|
||||
const { success } = useToast();
|
||||
const [settings, setSettings] = useState({
|
||||
siteName: 'The Order',
|
||||
@@ -14,7 +14,7 @@ export default function SettingsPage() {
|
||||
apiRateLimit: 100,
|
||||
});
|
||||
|
||||
const handleSave = () => {
|
||||
const handleSave = (): void => {
|
||||
// In production, this would save to an API
|
||||
success('Settings saved successfully', 'Your changes have been applied.');
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton, Dropdown } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function UsersPage() {
|
||||
const apiClient = getApiClient();
|
||||
export default function UsersPage(): JSX.Element {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
|
||||
// Mock data - in production, this would fetch from an API
|
||||
@@ -23,7 +22,7 @@ export default function UsersPage() {
|
||||
});
|
||||
|
||||
const filteredUsers = users?.filter(
|
||||
(user) =>
|
||||
(user: { email: string; name: string }) =>
|
||||
user.email.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
user.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }) {
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }): JSX.Element | null {
|
||||
const { isAuthenticated, isLoading } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ import { useRouter } from 'next/navigation';
|
||||
import { Button } from '@the-order/ui';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function Header() {
|
||||
export function Header(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { isAuthenticated, user, logout } = useAuth();
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = (): void => {
|
||||
logout();
|
||||
router.push('/login');
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactNode, useState } from 'react';
|
||||
import { ToastProvider } from '@the-order/ui';
|
||||
|
||||
export function Providers({ children }: { children: ReactNode }) {
|
||||
export function Providers({ children }: { children: ReactNode }): JSX.Element {
|
||||
const [queryClient] = useState(
|
||||
() =>
|
||||
new QueryClient({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
export function middleware(request: NextRequest): NextResponse {
|
||||
// Check if the request is for a protected route
|
||||
const protectedRoutes = ['/review', '/credentials', '/metrics', '/audit'];
|
||||
const isProtectedRoute = protectedRoutes.some((route) => request.nextUrl.pathname.startsWith(route));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function AboutPage() {
|
||||
export default function AboutPage(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 py-12">
|
||||
<div className="container mx-auto px-4 max-w-4xl">
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
import { useToast } from '@the-order/ui';
|
||||
|
||||
export default function ApplyPage() {
|
||||
export default function ApplyPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const apiClient = getApiClient();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -25,9 +25,9 @@ export default function ApplyPage() {
|
||||
country: '',
|
||||
});
|
||||
|
||||
const mutation = useMutation({
|
||||
const mutation = useMutation<Awaited<ReturnType<typeof apiClient.eresidency.submitApplication>>, Error, typeof formData>({
|
||||
mutationFn: async (data: typeof formData) => {
|
||||
return apiClient.eresidency.submitApplication({
|
||||
return await apiClient.eresidency.submitApplication({
|
||||
email: data.email,
|
||||
givenName: data.givenName,
|
||||
familyName: data.familyName,
|
||||
@@ -57,12 +57,12 @@ export default function ApplyPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>): void => {
|
||||
e.preventDefault();
|
||||
mutation.mutate(formData);
|
||||
};
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
||||
setFormData({
|
||||
...formData,
|
||||
[e.target.name]: e.target.value,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Textarea, Button, useToast } from '@the-order/ui';
|
||||
|
||||
export default function ContactPage() {
|
||||
export default function ContactPage(): JSX.Element {
|
||||
const { success, error: showError } = useToast();
|
||||
const [formData, setFormData] = useState({
|
||||
name: '',
|
||||
@@ -13,7 +13,7 @@ export default function ContactPage() {
|
||||
});
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>): Promise<void> => {
|
||||
e.preventDefault();
|
||||
setIsSubmitting(true);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function DocsPage() {
|
||||
export default function DocsPage(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 py-12">
|
||||
<div className="container mx-auto px-4 max-w-4xl">
|
||||
|
||||
@@ -9,7 +9,7 @@ export default function Error({
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
}): JSX.Element {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
@@ -14,7 +14,7 @@ export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="flex flex-col min-h-screen">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import { useToast } from '@the-order/ui';
|
||||
|
||||
export default function LoginPage() {
|
||||
export default function LoginPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { login } = useAuth();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -17,7 +17,7 @@ export default function LoginPage() {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [loginError, setLoginError] = useState<string | null>(null);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>): Promise<void> => {
|
||||
e.preventDefault();
|
||||
setIsLoading(true);
|
||||
setLoginError(null);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function NotFound() {
|
||||
export default function NotFound(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 flex items-center justify-center px-4">
|
||||
<Card className="max-w-md w-full text-center">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function Home() {
|
||||
export default function Home(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100">
|
||||
<div className="container mx-auto px-4 py-16">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function PrivacyPage() {
|
||||
export default function PrivacyPage(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 py-12">
|
||||
<div className="container mx-auto px-4 max-w-4xl">
|
||||
|
||||
@@ -5,14 +5,17 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Label } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function StatusPage() {
|
||||
export default function StatusPage(): JSX.Element {
|
||||
const searchParams = useSearchParams();
|
||||
const applicationId = searchParams.get('id');
|
||||
const apiClient = getApiClient();
|
||||
|
||||
const { data: application, isLoading, error } = useQuery({
|
||||
const { data: application, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.eresidency.getApplication>>>({
|
||||
queryKey: ['application', applicationId],
|
||||
queryFn: () => apiClient.eresidency.getApplication(applicationId!),
|
||||
queryFn: async () => {
|
||||
if (!applicationId) throw new Error('Application ID is required');
|
||||
return await apiClient.eresidency.getApplication(applicationId);
|
||||
},
|
||||
enabled: !!applicationId,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function TermsPage() {
|
||||
export default function TermsPage(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 py-12">
|
||||
<div className="container mx-auto px-4 max-w-4xl">
|
||||
|
||||
@@ -5,15 +5,15 @@ import { useMutation } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Button, Alert, AlertDescription, useToast } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function VerifyPage() {
|
||||
export default function VerifyPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
const { success, error: showError } = useToast();
|
||||
const [credentialId, setCredentialId] = useState('');
|
||||
const [verificationResult, setVerificationResult] = useState<{ valid: boolean; error?: string } | null>(null);
|
||||
|
||||
const mutation = useMutation({
|
||||
const mutation = useMutation<Awaited<ReturnType<typeof apiClient.identity.verifyCredential>>, Error, string>({
|
||||
mutationFn: async (id: string) => {
|
||||
return apiClient.identity.verifyCredential({
|
||||
return await apiClient.identity.verifyCredential({
|
||||
credential: {
|
||||
id,
|
||||
},
|
||||
@@ -37,7 +37,7 @@ export default function VerifyPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>): void => {
|
||||
e.preventDefault();
|
||||
if (!credentialId.trim()) {
|
||||
setVerificationResult({ valid: false, error: 'Please enter a credential ID' });
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }) {
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }): JSX.Element | null {
|
||||
const { isAuthenticated, isLoading } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
export function Footer() {
|
||||
export function Footer(): JSX.Element {
|
||||
return (
|
||||
<footer className="border-t bg-gray-50 mt-auto">
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
|
||||
@@ -5,11 +5,11 @@ import { useRouter } from 'next/navigation';
|
||||
import { Button } from '@the-order/ui';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function Header() {
|
||||
export function Header(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { isAuthenticated, user, logout } = useAuth();
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = (): void => {
|
||||
logout();
|
||||
router.push('/');
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactNode, useState } from 'react';
|
||||
import { ToastProvider } from '@the-order/ui';
|
||||
|
||||
export function Providers({ children }: { children: ReactNode }) {
|
||||
export function Providers({ children }: { children: ReactNode }): JSX.Element {
|
||||
const [queryClient] = useState(
|
||||
() =>
|
||||
new QueryClient({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
export function middleware(request: NextRequest): NextResponse {
|
||||
// Public portal routes are generally open
|
||||
// Only protect specific routes if needed
|
||||
const protectedRoutes: string[] = []; // Add protected routes here if needed
|
||||
|
||||
Reference in New Issue
Block a user