working on edge key with public server key.

This commit is contained in:
charlesgauthereau
2025-10-31 17:55:16 +01:00
parent e3239639f3
commit 027928c29f
5 changed files with 38 additions and 17 deletions
@@ -1,25 +1,20 @@
"use client";
import {generateEdgeKey} from "@/utils/edge_key";
import {getServerUrl} from "@/utils/get-server-url";
import {PasswordInput} from "@/components/wrappers/auth/password-input/password-input";
import {useState} from "react";
import {CopyButton} from "@/components/wrappers/common/button/copy-button";
import {Agent} from "@/db/schema/08_agent";
export type AgentCardKeyProps = {
agent: Agent;
edgeKey: string;
};
export const AgentCardKey = (props: AgentCardKeyProps) => {
const edge_key = generateEdgeKey(getServerUrl(), props.agent.id);
const [code, setCode] = useState<string>(`${edge_key}`);
export const AgentCardKey = ({edgeKey}: AgentCardKeyProps) => {
const [code, setCode] = useState<string>(`${edgeKey}`);
return (
<>
<PasswordInput
value={code}
onChange={() => {
setCode(edge_key);
setCode(edgeKey);
}}
/>
<CopyButton className="mt-5" value={code}/>