import { SelectOption } from "./models/components"; import { LinkStatusOption, MediaTypeOption } from "./models/global"; import { LockIcon } from "@app/assets/images/icons"; const isPremium = sfsyncData.is_premium; // Shared WP-admin-chrome vertical offset in rem, mirroring $shell-chrome-offset // in theme.scss — the single source of truth for the value previously // hardcoded as "5.6rem" independently in style.scss, iframe-styles.scss, and // Iframe.tsx. Was 5.6 (top admin bar + wp-admin footer // headroom); reduced to 2 ($wp-adminbar-height only) now that the footer's // own reserved space is neutralized and it's hidden outright on this screen // — keep in sync with theme.scss's value. export const SHELL_CHROME_OFFSET_REM = 2; // Route the sidebar's "Add account" item links to; App.tsx renders the same // SplashScreen used for first-time onboarding at this path instead of the // authenticated shell, so both flows share one component. export const ADD_ACCOUNT_PATH = "/add-account"; // Temporarily hidden: the Settings page's admin-facing Dashboard appearance // picker (automatic/light/dark). SettingsContext still forces "light" // regardless of this flag, so neither a previously-saved light/dark // preference nor the visitor's own OS/browser dark-mode setting keeps // applying while the picker is gone. The underlying capability // (handleChangeAdminTheme, the REST field, the data-sfsync-theme token // override) is untouched - flip this back to true to bring the section back. export const DASHBOARD_APPEARANCE_ENABLED = false; // Re-enabled: the page_slug collision that overwrote an existing account's // WP page on connect is fixed (uniqueness is now enforced against all // existing configs, and connection credentials are stored per-connection // via a hash key instead of a single global one). A known residual risk // remains — a per-key plan/site tracking gap can still make a 2nd account's // Grid Manager fail with "API key not authorised" — being tracked // separately; flip this back to false if that resurfaces broadly. const ADD_ACCOUNT_CODE_SWITCH = true; // Per-site override, stored in wp_options and not exposed through any // settings UI or REST route — edited directly in a site's DB when that // site should have the feature while it stays off everywhere else. Read // live (not snapshotted) so it doesn't need its own module-load ordering. export const isAddAccountEnabled = () => ADD_ACCOUNT_CODE_SWITCH && sfsyncData.settings.add_account_enabled === true; export const linkStatusOptions: LinkStatusOption[] = [ { text: "Linked", value: "linked", }, { text: "Unlinked", value: "unlinked", }, ]; export const mediaTypeOptions: MediaTypeOption[] = [ { text: "Image", value: "IMAGE", }, { text: "Video", value: "VIDEO", }, { text: "Carousel Album", value: "CAROUSEL_ALBUM", }, ]; export const mediaLimitOptions: SelectOption[] = [ { text: "Last 3 posts", value: "3", }, { text: "Last 6 posts", value: "6", icon: !isPremium ? LockIcon : null, }, { text: "Last 9 posts", value: "9", icon: !isPremium ? LockIcon : null, }, { text: "Last 12 posts", value: "12", icon: !isPremium ? LockIcon : null, }, { text: "Last 15 posts", value: "15", icon: !isPremium ? LockIcon : null, }, { text: "Last 30 posts", value: "30", icon: !isPremium ? LockIcon : null, }, { text: "Last 45 posts", value: "45", icon: !isPremium ? LockIcon : null, }, { text: "Last 60 posts", value: "60", icon: !isPremium ? LockIcon : null, }, { text: "Last 75 posts", value: "75", icon: !isPremium ? LockIcon : null, }, { text: "Last 90 posts", value: "90", icon: !isPremium ? LockIcon : null, }, { text: "Last 120 posts", value: "120", icon: !isPremium ? LockIcon : null, }, { text: "Last 150 posts", value: "150", icon: !isPremium ? LockIcon : null, }, { text: "Last 180 posts", value: "180", icon: !isPremium ? LockIcon : null, }, { text: "Last 210 posts", value: "210", icon: !isPremium ? LockIcon : null, }, { text: "Last 240 posts", value: "240", icon: !isPremium ? LockIcon : null, }, { text: "Last 270 posts", value: "270", icon: !isPremium ? LockIcon : null, }, { text: "Last 300 posts", value: "300", icon: !isPremium ? LockIcon : null, }, { text: "Last 330 posts", value: "330", icon: !isPremium ? LockIcon : null, }, { text: "Last 360 posts", value: "360", icon: !isPremium ? LockIcon : null, }, { text: "Last 390 posts", value: "390", icon: !isPremium ? LockIcon : null, }, { text: "Last 420 posts", value: "420", icon: !isPremium ? LockIcon : null, }, { text: "Last 450 posts", value: "450", icon: !isPremium ? LockIcon : null, }, ];