initial commit

This commit is contained in:
Giovanni Rezcjikov
2026-03-08 14:54:29 +03:00
commit f4e4fb21e3
75 changed files with 7407 additions and 0 deletions
@@ -0,0 +1,41 @@
"use client"
import { useLocale, useTranslations } from "next-intl";
import type { Consent } from "@/types";
import { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } from "@/components/ui/item"
import { Button } from "@/components/ui/button";
import { localeMap } from "@/types";
import { enUS } from "date-fns/locale";
import { format } from "date-fns";
interface Props {
consents: Consent[] | [];
setConsents: (consents: Consent[]) => void;
}
export default function Applications({ consents, setConsents }: Props) {
const t = useTranslations("MePage.items.applications");
const locale = useLocale();
const dateLocale = localeMap[locale as keyof typeof localeMap] ?? enUS;
return (
<div className="w-full lg:max-w-sm flex flex-col gap-4">
<h1 className="text-xl">{t("title")}</h1>
<div className="space-y-4">
{consents.map((consent) => (
<Item key={consent.client_id}>
<ItemContent>
<ItemTitle>{consent.client_name}</ItemTitle>
<ItemDescription>{t("authorized")} {format(consent.authorized_at, "PPP", { locale: dateLocale }) }</ItemDescription>
</ItemContent>
<ItemActions>
<Button disabled={!consent.isRevokable}>{t("revoke")}</Button>
</ItemActions>
</Item>
))}
</div>
</div>
);
}