import { useTranslation } from "react-i18next";

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

export const useCreateAddress = (asset: AssetModel) => {
	const { t } = useTranslation("translation");
	return {
		createAddress: () => {
			const addressParts = [
				asset.country,
				asset.region,
				asset.city,
				asset.street,
				asset.house && asset.building ? `${asset.house}/${asset.building}` : asset.house || asset.building,
				asset.apartment
			].filter(Boolean);

			return addressParts.join(', ');
		}
	};
};
