"use client"; import { useActionState } from "react"; import { Checkbox, Rule, Select } from "@unlocalhosted/metalui"; import { createRepoAction } from "@/app/actions/repo"; import { BookIcon, GlobeIcon, LockIcon, PlusIcon } from "@/components/icons"; import { ChoiceCards, TextField } from "@/components/settings-fields"; import { PlateBody, PlateFooter } from "@/components/settings-plate"; import { Alert, Avatar, Box, Button } from "@/components/ui"; export function NewRepoForm({ owners, owner }: { owners: string[]; owner: string }) { const [state, action, pending] = useActionState(createRepoAction, undefined); return (
Owner {owners.length > 1 ? ( // You, or an organization you may create repositories in. )}
/
Visibility , title: "Public", description: "Anyone can see this repository. You choose who can push." }, { value: "private", icon: , title: "Private", description: "Only you and collaborators can see and push." }, ]} />
{state?.error && {state.error}}
); }