// Server wrapper for the QR Storefront hub.
// Feature gating is handled client-side by FeatureGuard, which shows a
// blurred-content upgrade overlay instead of redirecting or throwing.
import { getSession } from '@server/auth';
import HubClient from './HubClient';
import NotSignedIn from './NotSignedIn';
import FeatureGuard from '@client/components/FeatureGuard';

export default async function StorefrontHubServerPage() {
  const session = await getSession();
  const restaurantId = session?.restaurantId;
  if (!restaurantId) return <NotSignedIn scope="view" />;
  return (
    <FeatureGuard feature="storefront" featureName="QR Storefront">
      <HubClient />
    </FeatureGuard>
  );
}
