import { AssetModel } from "@/contracts/client.schemas";

export const formatAddress = (asset: AssetModel) => {
	if (!asset) return "addressNotSpecified";

	const parts = [
		asset.city,
		asset.street,
		asset.house,
		asset.building && `корп. ${asset.building}`,
		asset.apartment && `кв. ${asset.apartment}`,
	].filter(Boolean);

	return parts.length > 0 ? parts.join(", ") : "addressNotSpecified";
};
