import { cn } from '@/lib/utils';
import type { Organisation } from '@/types';

/**
 * The organisation's address, phone and email from System settings, shown
 * under its name on receipts and statements (AMCSMS §27).
 */
export default function OrganisationContact({
    organisation,
    className,
}: {
    organisation: Organisation;
    className?: string;
}) {
    const parts = [
        organisation.address,
        organisation.phone,
        organisation.email,
    ].filter(Boolean);

    if (parts.length === 0) {
        return null;
    }

    return (
        <p className={cn('text-xs text-ink-400', className)}>
            {parts.join(' · ')}
        </p>
    );
}
