"use client";

import type { CSSProperties } from "react";

import {
  selectPlayerStickyTopOffset,
  usePlayerTopBannerStore,
} from "@/stores/player-top-banner-store";

export function usePlayerStickyTopStyle(): CSSProperties {
  const offsetPx = usePlayerTopBannerStore(selectPlayerStickyTopOffset);
  if (offsetPx <= 0) {
    return { top: 0 };
  }
  return { top: offsetPx };
}
