feat(next-feedback): convert FeedbackOverlay to controlled component
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 2s
Monorepo Pipeline / 🧹 Lint (push) Successful in 50s
Monorepo Pipeline / 🧪 Test (push) Successful in 1m46s
Monorepo Pipeline / 🏗️ Build (push) Successful in 3m46s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
🏥 Server Maintenance / 🧹 Prune & Clean (push) Failing after 5s

This commit is contained in:
2026-02-14 02:05:02 +01:00
parent 9b1f3fb7e8
commit cb4ffcaeda

View File

@@ -31,12 +31,20 @@ interface Feedback {
comments: FeedbackComment[];
}
export function FeedbackOverlay({ onActiveChange }: { onActiveChange?: (active: boolean) => void }) {
const [isActive, setIsActive] = useState(false);
export function FeedbackOverlay({
isActive: externalIsActive,
onActiveChange
}: {
isActive?: boolean;
onActiveChange?: (active: boolean) => void
}) {
const [internalIsActive, setInternalIsActive] = useState(false);
useEffect(() => {
onActiveChange?.(isActive);
}, [isActive, onActiveChange]);
const isActive = externalIsActive !== undefined ? externalIsActive : internalIsActive;
const setIsActive = (val: boolean) => {
if (externalIsActive === undefined) setInternalIsActive(val);
onActiveChange?.(val);
};
const [hoveredElement, setHoveredElement] = useState<HTMLElement | null>(
null,
);