mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-20 22:24:28 +01:00
feat: server permission checking and v0.2.28 release (#178)
This commit is contained in:
43
components/PermissionError.tsx
Normal file
43
components/PermissionError.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
|
||||
import { AlertTriangle } from 'lucide-react'
|
||||
import { checkStartupPermissions } from '@/lib/startup-checks'
|
||||
import RecheckButton from './RecheckButton'
|
||||
|
||||
export default async function PermissionError() {
|
||||
const permissionResult = await checkStartupPermissions()
|
||||
|
||||
// If everything is fine, render nothing
|
||||
if (permissionResult.success) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Get error message
|
||||
const getErrorMessage = () => {
|
||||
return permissionResult.error?.message || 'Unknown permission error occurred.'
|
||||
}
|
||||
|
||||
return (
|
||||
<Alert variant="destructive" className="mb-4">
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
<AlertTitle className="font-bold">Permission Error</AlertTitle>
|
||||
<AlertDescription className="mt-2 flex flex-col">
|
||||
<div className="space-y-3">
|
||||
<span className="text-sm">
|
||||
{getErrorMessage()}{" "}
|
||||
<a
|
||||
href="https://docs.habittrove.com/troubleshooting"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline hover:text-red-300"
|
||||
>
|
||||
Troubleshooting Guide
|
||||
</a>
|
||||
</span>
|
||||
<div>
|
||||
<RecheckButton />
|
||||
</div>
|
||||
</div>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user