mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-31 23:19:15 +02:00
✨ Add admin control panel (#1726)
This commit is contained in:
parent
1b3b3aac50
commit
c5724f0118
27 changed files with 1672 additions and 40 deletions
|
@ -0,0 +1,42 @@
|
|||
import { Trans } from "@/components/trans";
|
||||
import { getLicense } from "@/features/licensing/queries";
|
||||
import { getUserCount } from "@/features/user/queries";
|
||||
import { isSelfHosted } from "@/utils/constants";
|
||||
import Link from "next/link";
|
||||
|
||||
export async function LicenseLimitWarning() {
|
||||
if (!isSelfHosted) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const [license, userCount] = await Promise.all([
|
||||
getLicense(),
|
||||
getUserCount(),
|
||||
]);
|
||||
|
||||
const userLimit = license?.seats ?? 1;
|
||||
|
||||
if (!userLimit || userCount <= userLimit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-muted p-2 text-center text-sm rounded-md m-1 text-muted-foreground">
|
||||
<Trans
|
||||
i18nKey="licenseLimitWarning"
|
||||
defaults="You have exceeded the limits of your license. Please <a>upgrade</a>."
|
||||
components={{
|
||||
a: (
|
||||
<Link
|
||||
prefetch={false}
|
||||
href="https://support.rallly.co/self-hosting/licensing"
|
||||
target="_blank"
|
||||
className="text-link"
|
||||
rel="noopener noreferrer"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue