import type { CiSecret } from "@refs/backend/contract"; import { Button, Empty, Input, InputArea, LayerCard, Select, Table, formatDate } from "@refs/design-system"; import { KeyIcon } from "@refs/design-system/icons"; import { useState } from "react"; import { Form, useNavigation } from "react-router"; /** The secrets of one owner, and a form to add one. Values are write-only: the table shows names and nothing else. */ export function SecretTable({ secrets, environments, empty }: { secrets: readonly CiSecret[]; environments?: readonly string[]; empty: string }) { const navigation = useNavigation(); const saving = navigation.state === "submitting" && navigation.formData?.get("intent") === "secret-set"; const [name, setName] = useState(""); const [value, setValue] = useState(""); return (
setName(event.target.value.toUpperCase())} className="font-mono" required /> {environments && ))} )}
); }