import { Alert } from '@/components/crm/Alert';

/**
 * A page body for someone whose permissions don't open the page: the page title and a warning
 * saying which permission to ask for. Same markup as Workflows' `NoWorkflowAccess`
 * (`features/workflows/ui/shared.tsx`), so no new styles.
 */
export function NoAccess({ title, children }: { title: string; children: React.ReactNode }) {
  return (
    <div className="companies-page">
      <div className="page-header">
        <div className="page-title">
          <h1>{title}</h1>
        </div>
      </div>
      <Alert tone="warning">{children}</Alert>
    </div>
  );
}
