g1t/apps/web/app/components/policy-notice.tsx
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge membership: owners, org roles, GitHub's repo roles, privileges, 2FA | 1 | import { ShieldAlert } from "lucide-react"; |
| 2 | import { Link } from "react-router"; | |
| 3 | ||
| 4 | import type { PolicyHold } from "@g1t/contracts"; | |
| 5 | ||
| 6 | /** | |
| 7 | * The notice across the top for someone a workspace holds out until they | |
| 8 | * meet its policy, such as one that requires two-factor authentication: | |
| 9 | * they keep their place and cannot use it until they turn it on. | |
| 10 | */ | |
| 11 | export function PolicyNotice({ held }: { held: PolicyHold[] }) { | |
| 12 | if (held.length === 0) return null; | |
| 13 | const twoFactor = held.some((hold) => hold.gap === "two_factor"); | |
| 14 | return ( | |
| 15 | <div | |
| 16 | role="alert" | |
| 17 | className="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-b border-warn/30 bg-warn/10 px-4 py-2 text-center text-sm" | |
| 18 | > | |
| 19 | <ShieldAlert size={15} aria-hidden="true" className="hidden shrink-0 text-warn sm:block" /> | |
| 20 | <span> | |
| 21 | {held.length === 1 | |
| 22 | ? held[0].reason | |
| 23 | : `${held.map((hold) => hold.slug).join(", ")} require two-factor authentication. Turn it on to use them again.`} | |
| 24 | </span> | |
| 25 | {twoFactor && ( | |
| 26 | <Link to="/settings/two-factor" className="font-medium underline underline-offset-4"> | |
| 27 | Turn on two-factor authentication | |
| 28 | </Link> | |
| 29 | )} | |
| 30 | </div> | |
| 31 | ); | |
| 32 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.