| 1 | import { BookLock, Globe } from "lucide-react"; |
| 2 | |
| 3 | import { |
| 4 | Field, |
| 5 | FieldContent, |
| 6 | FieldDescription, |
| 7 | FieldLabel, |
| 8 | FieldTitle, |
| 9 | } from "@/components/ui/field"; |
| 10 | import { RadioGroup, RadioGroupItem |
| 11 | |
| 12 | import type { repositoryVisibilities |
| 13 | |
| 14 | type Visibility |
| 15 | |
| 16 | export function VisibilityField({ |
| 17 | id, |
| 18 | value, |
| 19 | onChange, |
| 20 | }: { |
| 21 | /** Prefix for the radio ids, unique per form on the page. */ |
| 22 | id: string |
| 23 | value: Visibility |
| 24 | onChange: (value |
| 25 | }) { |
| 26 | return ( |
| 27 | <RadioGroup value={ |
| 28 | <FieldLabel htmlFor={ |
| 29 | <Field orientation=" |
| 30 | <Globe className=" |
| 31 | <FieldContent> |
| 32 | <FieldTitle>Public</FieldTitle |
| 33 | <FieldDescription> |
| 34 | Anyone on the internet can see this repository. |
| 35 | </FieldDescription> |
| 36 | </FieldContent> |
| 37 | <RadioGroupItem value=" |
| 38 | </Field> |
| 39 | </FieldLabel> |
| 40 | |
| 41 | <FieldLabel htmlFor={ |
| 42 | <Field orientation=" |
| 43 | <BookLock className=" |
| 44 | <FieldContent> |
| 45 | <FieldTitle>Private</FieldTitle |
| 46 | <FieldDescription> |
| 47 | You choose who can see and commit to this repository. |
| 48 | </FieldDescription> |
| 49 | </FieldContent> |
| 50 | <RadioGroupItem value=" |
| 51 | </Field> |
| 52 | </FieldLabel> |
| 53 | </RadioGroup> |
| 54 | ); |
| 55 | } |