2023-11-24 06:50:16 -06:00
|
|
|
import useLocalSettingsStore from "@/store/localSettings";
|
2023-08-01 15:20:05 -05:00
|
|
|
import Image from "next/image";
|
2023-08-15 20:29:38 -05:00
|
|
|
import Link from "next/link";
|
2024-06-04 15:59:49 -05:00
|
|
|
import React, { ReactNode } from "react";
|
2024-06-09 08:27:16 -05:00
|
|
|
import { Trans } from "next-i18next";
|
2023-08-01 15:20:05 -05:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
text?: string;
|
|
|
|
children: ReactNode;
|
2024-04-21 18:15:27 -05:00
|
|
|
"data-testid"?: string;
|
2023-08-01 15:20:05 -05:00
|
|
|
}
|
|
|
|
|
2024-04-21 18:15:27 -05:00
|
|
|
export default function CenteredForm({
|
|
|
|
text,
|
|
|
|
children,
|
|
|
|
"data-testid": dataTestId,
|
|
|
|
}: Props) {
|
2023-11-24 06:50:16 -06:00
|
|
|
const { settings } = useLocalSettingsStore();
|
2023-11-26 04:17:08 -06:00
|
|
|
|
2023-08-01 15:20:05 -05:00
|
|
|
return (
|
2024-04-21 18:15:27 -05:00
|
|
|
<div
|
|
|
|
className="absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center p-5"
|
|
|
|
data-testid={dataTestId}
|
|
|
|
>
|
2023-10-24 14:57:37 -05:00
|
|
|
<div className="m-auto flex flex-col gap-2 w-full">
|
2024-07-22 22:34:36 -05:00
|
|
|
{settings.theme && (
|
2023-11-06 07:25:57 -06:00
|
|
|
<Image
|
2024-07-27 17:41:13 -05:00
|
|
|
src={`/linkwarden_${
|
|
|
|
settings.theme === "dark" ? "dark" : "light"
|
|
|
|
}.png`}
|
2023-11-06 07:25:57 -06:00
|
|
|
width={640}
|
|
|
|
height={136}
|
|
|
|
alt="Linkwarden"
|
2025-01-05 10:57:08 -06:00
|
|
|
className="w-fit mx-auto"
|
2023-11-06 07:25:57 -06:00
|
|
|
/>
|
2024-07-22 22:34:36 -05:00
|
|
|
)}
|
|
|
|
{text && (
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto font-semibold px-2 text-center">
|
2023-08-01 15:20:05 -05:00
|
|
|
{text}
|
|
|
|
</p>
|
2024-07-22 22:34:36 -05:00
|
|
|
)}
|
2023-08-01 15:20:05 -05:00
|
|
|
{children}
|
2023-11-26 04:17:08 -06:00
|
|
|
<p className="text-center text-xs text-neutral mb-5">
|
2024-06-09 08:27:16 -05:00
|
|
|
<Trans
|
|
|
|
values={{ date: new Date().getFullYear() }}
|
|
|
|
i18nKey="all_rights_reserved"
|
|
|
|
components={[
|
|
|
|
<Link href="https://linkwarden.app" className="font-semibold" />,
|
|
|
|
]}
|
|
|
|
/>
|
2023-08-01 15:20:05 -05:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|