mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 15:22:12 +03:00
- Add emailPrivacyStore (Zustand + persist) for global toggle state - Add EmailPrivacyToggle component with eye open/closed icons - Add pickDisplayValue() visibility-aware masking function - Integrate toggle into provider detail, usage limits & playground pages - Per-modal showEmail now uses global store (synced across all pages) - Default: emails hidden; toggle persists across page reloads - Add showEmails/hideEmails i18n keys - Update CHANGELOG.md and openapi.yaml to v3.6.2
26 lines
641 B
TypeScript
26 lines
641 B
TypeScript
"use client";
|
|
|
|
import { create } from "zustand";
|
|
import { persist } from "zustand/middleware";
|
|
|
|
interface EmailPrivacyState {
|
|
/** When true, all email addresses are shown in full (unmasked). Default: false (masked). */
|
|
emailsVisible: boolean;
|
|
/** Toggle the global email visibility state. */
|
|
toggleEmailVisibility: () => void;
|
|
}
|
|
|
|
const useEmailPrivacyStore = create<EmailPrivacyState>()(
|
|
persist(
|
|
(set, get) => ({
|
|
emailsVisible: false,
|
|
toggleEmailVisibility: () => set({ emailsVisible: !get().emailsVisible }),
|
|
}),
|
|
{
|
|
name: "omniroute-email-privacy",
|
|
}
|
|
)
|
|
);
|
|
|
|
export default useEmailPrivacyStore;
|