2025-01-07 02:29:29 +08:00
|
|
|
|
'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';
|
2025-01-07 02:29:29 +08:00
|
|
|
|
import { BusterLogo } from '@/assets/svg/BusterLogo';
|
2025-02-20 11:05:30 +08:00
|
|
|
|
import { asset_typeToTranslation } from '@/components/ui';
|
|
|
|
|
import { Title } from '@/components/ui';
|
2025-01-07 02:29:29 +08:00
|
|
|
|
import { useBusterNotifications } from '@/context/BusterNotifications';
|
|
|
|
|
import { BusterRoutes, createBusterRoute } from '@/routes';
|
|
|
|
|
import { Button } from 'antd';
|
|
|
|
|
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;
|
2025-01-07 02:29:29 +08:00
|
|
|
|
dashboardId?: string;
|
2025-02-20 10:39:03 +08:00
|
|
|
|
}> = React.memo(({ asset_type }) => {
|
2025-01-07 02:29:29 +08:00
|
|
|
|
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">
|
2025-01-07 02:29:29 +08:00
|
|
|
|
<BusterLogo className="h-16 w-16" />
|
|
|
|
|
|
|
|
|
|
<div className="max-w-[340px] text-center">
|
|
|
|
|
<Title
|
|
|
|
|
level={2}
|
|
|
|
|
ellipsis={false}
|
|
|
|
|
className="text-center">{`It looks like you don’t have access to this ${asset_typeToTranslation(asset_type)}.`}</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';
|