import { type ReactNode } from "react";
import { Copy, UserCircle2 } from "lucide-react";
import { useMe } from "@/client/auth/use-me";
import { ErrorBanner } from "@/client/components/error-banner";
import { LoadingPanel } from "@/client/components/loading-panel";
import { Card, CardDescription, CardHeader, CardTitle } from "@/client/components/ui/card";
import { Copyable } from "@/client/components/ui/copyable";
import { PageHeader } from "@/client/components/ui/page-header";
import { Button } from "@/client/components/ui/button";
import { toast } from "@/client/lib/toast";
function FieldRow({ label, children }: { label: string; children: ReactNode }) {
return (
{label}
{children}
);
}
export function MePage() {
const me = useMe();
if (me.isPending) return ;
if (me.error) return ;
if (!me.data) return ;
const { subject_id, host_label, control_plane_host, dav_host, urls } = me.data;
const copyAll = () => {
const payload = `WebDAV / Files: ${urls.files}\nCalDAV: ${urls.caldav}\nCardDAV: ${urls.carddav}`;
void navigator.clipboard.writeText(payload).then(
() => toast.success("Copied all DAV URLs."),
() => toast.error("Could not copy all DAV URLs."),
);
};
return (
}
title="Your profile"
description="Paste a discovery URL into your DAV client to reach this account."
/>
Discovery URLs
Most clients only need the root URL — calendar-home and addressbook-home are exposed via DAV discovery
from there.
}
>
Copy all
This host
The opaque label your subject is reached under.
{host_label}
{dav_host}
{control_plane_host}
Internal identifiers
{subject_id}
);
}