docs: 📝 Add ContentFormat docs

This commit is contained in:
Jesse Wierzbinski 2024-07-22 20:21:38 +02:00
parent eb5a58621a
commit 9b75c25fa0
No known key found for this signature in database
4 changed files with 187 additions and 18 deletions

View file

@ -255,20 +255,17 @@ export const navigation: NavGroup[] = [
{ title: "Webhooks", href: "/webhooks" }, */
],
},
{
title: "Structures",
links: [
{ title: "ContentFormat", href: "/structures/content-format" },
{ title: "Collection", href: "/structures/collection" },
],
},
{
title: "Entities",
links: [{ title: "Users", href: "/entities/users" }],
},
/* {
title: "Resources",
links: [
{ title: "Contacts", href: "/contacts" },
{ title: "Conversations", href: "/conversations" },
{ title: "Messages", href: "/messages" },
{ title: "Groups", href: "/groups" },
{ title: "Attachments", href: "/attachments" },
],
}, */
];
export function Navigation(props: ComponentPropsWithoutRef<"nav">) {

View file

@ -92,17 +92,25 @@ export function Properties({ children }: { children: ReactNode }) {
);
}
const numberTypeTooltips = {
f64: "64-bit floating-point number",
i64: "64-bit signed integer",
u64: "64-bit unsigned integer",
};
export function Property({
name,
children,
type,
typeLink,
numberType,
required,
}: {
name: string;
children: ReactNode;
type?: string;
typeLink?: string;
numberType?: "f64" | "i64" | "u64";
required?: boolean;
}) {
return (
@ -120,6 +128,17 @@ export function Property({
</dd>
</>
)}
{numberType && (
<>
<dt className="sr-only">Type</dt>
<dd
className="inline-flex items-center rounded-md bg-blue-50 px-2 py-0 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-500/10 dark:bg-blue-500/10 dark:text-blue-100 dark:ring-blue-200/20 hover:cursor-pointer"
title={numberTypeTooltips[numberType]}
>
{numberType}
</dd>
</>
)}
{type && (
<>
<dt className="sr-only">Type</dt>