mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
27 lines
841 B
TypeScript
27 lines
841 B
TypeScript
import { TAvailablePeerInfoTo } from "./api/dto";
|
|
import { useFetcher } from "react-router-dom";
|
|
|
|
import "./PeerAvailableCard.scss";
|
|
|
|
export interface TPeerAvailableCardProps {
|
|
peerInfo: TAvailablePeerInfoTo;
|
|
}
|
|
|
|
export function PeerAvailableCard({ peerInfo }: TPeerAvailableCardProps) {
|
|
const fetcher = useFetcher();
|
|
|
|
return (
|
|
<div className="peerAvailableCard">
|
|
<div className={"peerInfo"}>
|
|
<span>UUID: </span>
|
|
<span>{peerInfo.uuid}</span>
|
|
</div>
|
|
<fetcher.Form method="put" action={"/home/peers"}>
|
|
<input name="intent" hidden={true} value={"add_peer"} />
|
|
<input name="uuid" hidden={true} value={peerInfo.uuid} />
|
|
<button type="submit">connect</button>
|
|
</fetcher.Form>
|
|
</div>
|
|
);
|
|
}
|