buster/web/src/controllers/AppNoPageAccess.tsx

48 lines
1.4 KiB
TypeScript
Raw Normal View History

'use client';
2025-02-20 10:39:03 +08:00
import React from 'react';
2025-02-01 02:04:49 +08:00
import { ShareAssetType } from '@/api/asset_interfaces';
import { BusterLogo } from '@/assets/svg/BusterLogo';
2025-03-02 14:05:55 +08:00
import { Title } from '@/components/ui/typography';
import { useBusterNotifications } from '@/context/BusterNotifications';
import { BusterRoutes, createBusterRoute } from '@/routes';
2025-03-08 07:02:56 +08:00
import { Button } from '@/components/ui/buttons';
import Link from 'next/link';
export const AppNoPageAccess: React.FC<{
2025-02-01 02:04:49 +08:00
asset_type: ShareAssetType;
2025-02-01 06:21:50 +08:00
metricId?: string;
dashboardId?: string;
2025-02-20 10:39:03 +08:00
}> = React.memo(({ asset_type }) => {
const { openInfoMessage } = useBusterNotifications();
return (
2025-02-19 13:43:51 +08:00
<div className="flex h-[85vh] w-full flex-col items-center justify-center space-y-6">
<BusterLogo className="h-16 w-16" />
<div className="max-w-[340px] text-center">
<Title
2025-03-02 14:05:55 +08:00
as="h2"
2025-03-08 07:02:56 +08:00
className="text-center">{`It looks like you dont have access to this file...`}</Title>
</div>
<div className="flex space-x-2">
<Button
onClick={() => {
openInfoMessage('Requesting access is not currently supported');
}}>
Request access
</Button>
<Link
href={createBusterRoute({
route: BusterRoutes.ROOT
})}>
<Button>Go back</Button>
</Link>
</div>
</div>
);
});
AppNoPageAccess.displayName = 'AppNoPageAccess';