import { getBrandSettingsPublic } from "@/actions/brand-settings";
import { getWholesaleSettingsPublic } from "@/actions/wholesale";
import AboutClient from "./AboutClient";

export default async function TuxedoAboutPage() {
  const settingsResult = await getBrandSettingsPublic("tuxedo");
  const settings = settingsResult.success ? settingsResult.settings : null;

  let address = "59751 David Road, Olathe, CO 81425";
  if (settings?.brand_id) {
    const wholesale = await getWholesaleSettingsPublic(settings.brand_id);
    if (wholesale?.invoice_business_address) {
      address = wholesale.invoice_business_address;
    }
  }

  return (
    <AboutClient
      logoUrl={settings?.logo_url ?? null}
      logoUrlDark={settings?.logo_url_dark ?? null}
      olatheSweetLogoUrlDark={settings?.olathe_sweet_logo_url_dark ?? null}
      aboutHeadline={settings?.about_headline ?? null}
      aboutSubheadline={settings?.about_subheadline ?? null}
      showWholesaleLink={settings?.show_wholesale_link ?? true}
      customFooterText={settings?.custom_footer_text ?? null}
      contactEmail={settings?.email ?? null}
      contactPhone={settings?.phone ?? null}
      address={address}
      isAdmin={false}
    />
  );
}
