feat(plans): publish honest Free and Pro
CI and Deploy / test (pull_request) Successful in 5m6s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-15 18:04:18 +02:00
parent a7c25499bb
commit a25c31b93a
26 changed files with 403 additions and 93 deletions
@@ -0,0 +1,52 @@
import React, { useState } from "react";
import CloseIcon from "@mui/icons-material/Close";
import { Alert, Button, IconButton, Stack, Typography } from "@mui/material";
type Props = {
featureKey: string;
title: string;
children: React.ReactNode;
};
function storageKey(featureKey: string) {
return `jobtracker.proNoticeDismissed.${featureKey}`;
}
export default function ProFeatureNotice({ featureKey, title, children }: Props) {
const [dismissed, setDismissed] = useState(() => {
if (typeof window === "undefined") return false;
try {
return window.sessionStorage.getItem(storageKey(featureKey)) === "true";
} catch {
return false;
}
});
if (dismissed) return null;
const dismiss = () => {
try {
window.sessionStorage.setItem(storageKey(featureKey), "true");
} catch {
// The notice can still be dismissed for this render when storage is unavailable.
}
setDismissed(true);
};
return (
<Alert
severity="info"
action={(
<Stack direction="row" spacing={0.5} alignItems="center">
<Button href="/settings" size="small">View Pro</Button>
<IconButton size="small" aria-label={`Dismiss ${title}`} onClick={dismiss}>
<CloseIcon fontSize="small" />
</IconButton>
</Stack>
)}
>
<Typography component="span" sx={{ fontWeight: 800 }}>{title}</Typography>{" "}
{children}
</Alert>
);
}