Skip to content

Commit 2cbbcaf

Browse files
committed
feat(webapp): add billing limits settings page and org banners
Configure a spend limit, manage billing alerts, and surface org-wide banners.
1 parent b238d14 commit 2cbbcaf

25 files changed

Lines changed: 3129 additions & 551 deletions
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { ExclamationCircleIcon } from "@heroicons/react/20/solid";
2+
import { AnimatePresence, motion } from "framer-motion";
3+
import tileBgPath from "~/assets/images/error-banner-tile@2x.png";
4+
import { Icon } from "~/components/primitives/Icon";
5+
import { Paragraph } from "~/components/primitives/Paragraph";
6+
import { cn } from "~/utils/cn";
7+
8+
type AnimatedOrgBannerBarProps = {
9+
show: boolean;
10+
variant: "warning" | "error";
11+
children: React.ReactNode;
12+
action?: React.ReactNode;
13+
};
14+
15+
export function AnimatedOrgBannerBar({
16+
show,
17+
variant,
18+
children,
19+
action,
20+
}: AnimatedOrgBannerBarProps) {
21+
return (
22+
<AnimatePresence initial={false}>
23+
{show ? (
24+
<motion.div
25+
className={cn(
26+
"flex h-10 items-center justify-between overflow-hidden py-0 pl-3 pr-2",
27+
variant === "warning"
28+
? "border-y border-amber-400/20 bg-warning/20"
29+
: "border border-error bg-repeat"
30+
)}
31+
style={
32+
variant === "error"
33+
? { backgroundImage: `url(${tileBgPath})`, backgroundSize: "8px 8px" }
34+
: undefined
35+
}
36+
initial={{ opacity: 0, height: 0 }}
37+
animate={{ opacity: 1, height: "2.5rem" }}
38+
exit={{ opacity: 0, height: 0 }}
39+
>
40+
<div className="flex items-center gap-2">
41+
<Icon
42+
icon={ExclamationCircleIcon}
43+
className={cn("h-5 w-5", variant === "warning" ? "text-amber-400" : "text-error")}
44+
/>
45+
<Paragraph
46+
variant="small"
47+
className={variant === "warning" ? "text-amber-200" : "text-error"}
48+
>
49+
{children}
50+
</Paragraph>
51+
</div>
52+
{action}
53+
</motion.div>
54+
) : null}
55+
</AnimatePresence>
56+
);
57+
}

0 commit comments

Comments
 (0)