Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

890 B
Raw Blame
import { useEffect, useRef } from 'react';
import { useTranslation } from '../../i18n';
import { useStudioStore } from '../../store/studioStore';
import { useToast } from '../shared/Toast';

/**
 * What the Studio says about a click it could not carry out. Today one thing:
 * the page already holds as many elements as a page can, so a sticker, a frame,
 * a paste or a duplicate was not added. Every path that refuses counts it in the
 * store, and this says it once per count rather than each path in its own words.
 */
export function StudioNotices() {
  const { t } = useTranslation();
  const toast = useToast();
  const refused = useStudioStore((s) => s.refusedFull);
  const seen = useRef(refused);
  useEffect(() => {
    if (refused === seen.current) return;
    seen.current = refused;
    toast.warning(t('journey.studio.pageFull'));
  }, [refused, toast, t]);
  return null;
}