mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-19 14:01:18 +00:00
Make the web app consume the live mount contract
Add the first control-plane UI over the verified backend seam so exports, issued DAV credentials, and Finder instructions can be exercised from the running stack.
This commit is contained in:
parent
b5f8ea9c52
commit
87de69520c
8 changed files with 773 additions and 51 deletions
29
apps/web/app/copy-field.tsx
Normal file
29
apps/web/app/copy-field.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"use client";
|
||||
|
||||
import { Button } from "@betternas/ui/button";
|
||||
import { Code } from "@betternas/ui/code";
|
||||
import { useState } from "react";
|
||||
import styles from "./copy-field.module.css";
|
||||
|
||||
export function CopyField({ label, value }: { label: string; value: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
return (
|
||||
<div className={styles.field}>
|
||||
<div className={styles.header}>
|
||||
<span className={styles.label}>{label}</span>
|
||||
<Button
|
||||
className={styles.button}
|
||||
onClick={async () => {
|
||||
await navigator.clipboard.writeText(value);
|
||||
setCopied(true);
|
||||
window.setTimeout(() => setCopied(false), 1500);
|
||||
}}
|
||||
>
|
||||
{copied ? "Copied" : "Copy"}
|
||||
</Button>
|
||||
</div>
|
||||
<Code className={styles.value}>{value}</Code>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue