"use client"; import { MapPinIcon } from "lucide-react"; import { useTranslations } from "next-intl"; import Image from "next/image"; import { ReactNode } from "react"; import { AttributeElement } from "../../../../components"; import { SectionHeader, MicroLabel } from "../../../../components/typography"; import { FiscalDataDisplay } from "../../../../components/fiscal/FiscalDataDisplay"; import { CompanyInterface } from "../../data"; type CompanyContentProps = { company?: CompanyInterface; actions?: ReactNode; }; function hasAddressDetails(company: CompanyInterface): boolean { return !!( company.street || company.street_number || company.city || company.province || company.region || company.postcode || company.country ); } export function CompanyContent({ company, actions }: CompanyContentProps) { const t = useTranslations(); if (!company) return null; return (
{/* Title Row */}
{company.name} {actions &&
{actions}
}
{/* Hero Section */}
{company.logo && ( {company.name} )}
{company.legal_address && (
{company.legal_address}
)}
{company.configurations?.country && (
{t("features.configuration.country")}:{" "} {company.configurations.country}
)} {company.configurations?.currency && (
{t("features.configuration.currency")}:{" "} {company.configurations.currency}
)}
{/* Fiscal Data Section */} {company.fiscal_data && (
{t("company.sections.fiscal_data")}
)} {/* Address Details Section */} {hasAddressDetails(company) && (
{t("company.sections.address_details")}
{company.street && } {company.street_number && ( )} {company.city && } {company.province && ( )} {company.region && } {company.postcode && ( )} {company.country && }
)}
); }