export function setPublishedAt({
  data,
}: {
  data?: { status?: string; publishedAt?: string | null };
}) {
  if (!data) return data;

  if (data.status === "published" && !data.publishedAt) {
    data.publishedAt = new Date().toISOString();
  }

  return data;
}
