'use server';

import { cookies } from 'next/headers';

export async function getServerCookie(key: string): Promise<string | undefined> {
  // This will only run during SSR, not during static export
  if (process.env.NEXT_PHASE === 'phase-production-build') {
    return undefined;
  }
  return (await cookies()).get(key)?.value;
}