Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Fix the billing usage layout
Acho Arnold Ewine26e65e2b3fc
diff --git a/web/app/pages/billing/index.vue b/web/app/pages/billing/index.vueindex 592e6780..d18cb560 100644--- a/web/app/pages/billing/index.vue+++ b/web/app/pages/billing/index.vue@@ -15,6 +15,7 @@ import type {ResponsesUserSubscriptionPaymentsResponse,} from "~~/shared/types/api";import { formatBillingPeriodDateOrdinal } from "~/utils/filters";+import { countries, getStateOptions } from "~/utils/countries";definePageMeta({middleware: ["auth"],@@ -80,6 +81,10 @@ const subscriptionIsCancelled = computed(() => authStore.user?.subscription_status === "cancelled",);+const invoiceStateOptions = computed(() =>+ getStateOptions(invoiceFormCountry.value),+);+const totalMessages = computed(() => {if (!billingStore.billingUsage) return 0;return billingStore.billingUsage.sent_messages + billingStore.billingUsage.received_messages;@@ -202,16 +207,16 @@ onMounted(async () => {location="bottom"/></VAppBar>- <VContainer class="mt-16">+ <VContainer><VRow><VCol cols="12" md="9" offset-md="1" xl="8" offset-xl="2"><!-- Current Plan -->- <h4 class="text-h4 mb-3 mt-3">Current Plan</h4>+ <h4 class="text-headline-large mb-3 mt-0">Current Plan</h4><VRow v-if="authStore.user">- <VCol md="6" xl="4">- <VAlert type="info" variant="tonal" prominent>+ <VCol md="6">+ <VAlert type="info" :icon="false" variant="tonal" prominent><div>- <h1 class="text-subtitle-1 font-weight-bold text-uppercase mt-3">+ <h1 class="text-title-large mt-0 mb-0 font-weight-bold text-uppercase"><span v-if="isOnFreePlan">{{ plan.name }}</span><span v-else-if="subscriptionIsCancelled"><span class="text-warning">{{ plan.name }}</span> → Free@@ -220,7 +225,7 @@ onMounted(async () => {</h1><pv-if="!isOnFreePlan && !isOnLifetimePlan && !subscriptionIsCancelled"- class="text-medium-emphasis"+ class="text-medium-emphasis mt-1">Your next bill is for <b>${{ plan.price }}</b> on<b>{{@@ -237,11 +242,11 @@ onMounted(async () => {new Date(authStore.user.subscription_ends_at!).toLocaleDateString()}}</b></p>- <p v-else class="text-medium-emphasis">+ <p v-else class="text-medium-emphasis mt-1">{{ totalMessages }}/{{ plan.messagesPerMonth }} messages</p></div>- <div class="d-flex mb-2 mt-2">+ <div class="d-flex mb-1 mt-1"><VBtnv-if="!subscriptionIsCancelled && !isOnFreePlan && !isOnLifetimePlan"color="primary"@@ -262,6 +267,7 @@ onMounted(async () => {v-if="!subscriptionIsCancelled && !isOnFreePlan && !isOnLifetimePlan"v-model="dialog"max-width="590"+ opacity="0.9"><template #activator="{ props: activatorProps }"><VBtn v-bind="activatorProps" color="error" variant="text">@@ -270,7 +276,7 @@ onMounted(async () => {</template><VCard><VCardText class="pt-4">- <h2 class="text-h5 mb-2">+ <h2 class="text-headline-medium mb-2">Are you sure you want to cancel your subscription?</h2><p>@@ -307,57 +313,41 @@ onMounted(async () => {<!-- Upgrade Plan (only for free users) --><template v-if="isOnFreePlan">- <h2 class="text-h4 mt-4 mb-2">Upgrade Plan</h2>+ <h2 class="text-headline-large mt-4 mb-2">Upgrade Plan</h2><VRow>- <VCol cols="12" md="6" xl="4">- <VCard variant="outlined" :href="checkoutURL">- <VCardText>- <VRow align="center">- <VCol class="flex-grow-1">- <h1 class="text-subtitle-1 font-weight-bold text-uppercase mt-3">- Pro - Monthly- </h1>- <p class="text-medium-emphasis">5,000 messages monthly</p>- </VCol>- <VCol class="flex-shrink-1">- <span class="text-h5">$10</span>/month- </VCol>- </VRow>- </VCardText>- </VCard>- </VCol>- <VCol cols="12" md="6" xl="4">- <VCard variant="outlined" :href="checkoutURL">+ <VCol cols="12" md="6">+ <VCard :href="checkoutURL" link><VCardText><VRow align="center">- <VCol class="flex-grow-1">- <h1 class="text-subtitle-1 font-weight-bold text-uppercase mt-3">- Pro - Yearly- <VChip size="small" color="primary" class="mt-n1">- 2 months free- </VChip>+ <VCol class="flex-grow-1 flex-shrink-1">+ <h1 class="text-title-large font-weight-bold text-uppercase mt-3">+ Pro Plan</h1>- <p class="text-medium-emphasis">5,000 messages monthly</p>+ <p class="text-medium-emphasis">+ Send and receive up to 20,000 messages per month+ </p></VCol>- <VCol class="flex-shrink-1">- <span class="text-h5">$100</span>/year+ <VCol class="flex-grow-0 flex-shrink-0">+ <span class="text-headline-medium">$10</span>/month</VCol></VRow></VCardText></VCard></VCol>- <VCol cols="12" md="6" xl="4">- <VCard variant="outlined" :href="enterpriseCheckoutURL">+ <VCol cols="12" md="6">+ <VCard :href="enterpriseCheckoutURL" link><VCardText><VRow align="center">- <VCol class="flex-grow-1">- <h1 class="text-subtitle-1 font-weight-bold text-uppercase mt-3">- 100k - Monthly+ <VCol class="flex-grow-1 flex-shrink-1">+ <h1 class="text-title-large font-weight-bold text-uppercase mt-3">+ Enterprise Plan</h1>- <p class="text-medium-emphasis">100,000 messages monthly</p>+ <p class="text-medium-emphasis">+ Send and receive up to 200,000 messages per month+ </p></VCol>- <VCol class="flex-shrink-1">- <span class="text-h5">$175</span>/month+ <VCol class="flex-grow-0 flex-shrink-0">+ <span class="text-headline-medium">$89</span>/month</VCol></VRow></VCardText>@@ -367,7 +357,7 @@ onMounted(async () => {</template><!-- Overview -->- <h4 class="text-h4 mb-3 mt-8">Overview</h4>+ <h4 class="text-headline-large mb-3 mt-8">Overview</h4><p class="text-medium-emphasis">This is the summary of the sent messages and received messages in<code@@ -383,50 +373,37 @@ onMounted(async () => {/>.</p><VRow v-if="billingStore.billingUsage">- <VCol cols="12" md="4">+ <VCol cols="12" md="6"><VAlerttype="info"variant="tonal":icon="mdiCallMade"prominent>- <h2 class="text-h4 font-weight-bold mt-4">+ <h2 class="text-headline-large my-0">{{ formatDecimal(billingStore.billingUsage.sent_messages) }}</h2><p class="text-medium-emphasis mt-n1">Messages Sent</p></VAlert></VCol>- <VCol cols="12" md="4">+ <VCol cols="12" md="6"><VAlerttype="warning"variant="tonal":icon="mdiCallReceived"prominent>- <h2 class="text-h4 font-weight-bold mt-4">+ <h2 class="text-headline-large font-weight-bold my-0">{{ formatDecimal(billingStore.billingUsage.received_messages) }}</h2><p class="text-medium-emphasis mt-n1">Messages Received</p></VAlert></VCol>- <VCol cols="12" md="4">- <VAlert- type="success"- variant="tonal"- :icon="mdiCreditCard"- prominent- >- <h2 class="text-h4 font-weight-bold mt-4">- {{ formatMoney(billingStore.billingUsage.total_cost) }}- </h2>- <p class="text-medium-emphasis mt-n1">Total Cost</p>- </VAlert>- </VCol></VRow><!-- Subscription Payments --><template v-if="authStore.user?.subscription_id != null">- <h4 class="text-h4 mb-3 mt-8">Subscription Payments</h4>+ <h4 class="text-headline-large mb-3 mt-8">Subscription Payments</h4><p class="text-medium-emphasis">This is a list of your last 10 subscription payments made usingour payment provider@@ -492,14 +469,14 @@ onMounted(async () => {</template><!-- Usage History -->- <h4 class="text-h4 mb-3 mt-8">Usage History</h4>+ <h4 class="text-headline-large mb-3 mt-8">Usage History</h4><p class="text-medium-emphasis">Summary of all the sent and received messages in the past 12billing periods</p>- <VTable>+ <VTable density="comfortable"><thead>- <tr class="text-uppercase">+ <tr class="text-uppercase text-medium-emphasis"><th class="text-left">Start Date</th><th class="text-left">End Date</th><th class="text-left">@@ -534,9 +511,10 @@ onMounted(async () => {v-model="subscriptionInvoiceDialog"persistentmax-width="600"+ opacity="0.9"><VCard>- <VCardTitle class="text-h4">Generate Invoice</VCardTitle>+ <VCardTitle class="text-headline-large">Generate Invoice</VCardTitle><VCardSubtitle class="mt-n1">Create an invoice for your<b>{{ selectedPayment?.attributes.total_formatted }}</b> payment on@@ -588,6 +566,7 @@ onMounted(async () => {</VCol><VCol cols="6"><VTextField+ v-if="invoiceStateOptions.length === 0"v-model="invoiceFormState"density="compact":disabled="loading"@@ -598,6 +577,19 @@ onMounted(async () => {persistent-placeholdervariant="outlined"/>+ <VAutocomplete+ v-else+ v-model="invoiceFormState"+ density="compact"+ :disabled="loading"+ :error="errorMessages.has('state')"+ :error-messages="errorMessages.get('state')"+ :items="invoiceStateOptions"+ label="State"+ placeholder="e.g CA"+ persistent-placeholder+ variant="outlined"+ /></VCol></VRow><VRow>@@ -615,12 +607,13 @@ onMounted(async () => {/></VCol><VCol cols="6">- <VTextField+ <VAutocompletev-model="invoiceFormCountry"density="compact":disabled="loading":error="errorMessages.has('country')":error-messages="errorMessages.get('country')"+ :items="countries"label="Country"placeholder="e.g United States"persistent-placeholder@@ -652,7 +645,7 @@ onMounted(async () => {Download Invoice</VBtn><VSpacer />- <VBtn color="error" variant="text" @click="subscriptionInvoiceDialog = false">+ <VBtn color="warning" variant="text" @click="subscriptionInvoiceDialog = false">Close</VBtn></VCardActions>diff --git a/web/app/pages/index.vue b/web/app/pages/index.vueindex 08eedc03..f3c6eedd 100644--- a/web/app/pages/index.vue+++ b/web/app/pages/index.vue@@ -773,7 +773,7 @@ Console.WriteLine(await response.Content.ReadAsStringAsync());</code></pre></VCol><!-- Pro Plan --><VCol cols="12" lg="4">- <VCard elevation="4" color="#121212">+ <VCard elevation="4" color="#000000"><VCardText><h1 class="text-center text-display-medium mt-0 mb-4 text-primary">Pro</h1><p class="text-body-large text-center mt-0 text-medium-emphasis">diff --git a/web/app/utils/countries.ts b/web/app/utils/countries.tsnew file mode 100644index 00000000..ab2e8f38--- /dev/null+++ b/web/app/utils/countries.ts@@ -0,0 +1,335 @@+export type SelectOption = {+ title: string;+ value: string;+};++export const countries: SelectOption[] = [+ { title: "Afghanistan", value: "AF" },+ { title: "Åland Islands", value: "AX" },+ { title: "Albania", value: "AL" },+ { title: "Algeria", value: "DZ" },+ { title: "American Samoa", value: "AS" },+ { title: "Andorra", value: "AD" },+ { title: "Angola", value: "AO" },+ { title: "Anguilla", value: "AI" },+ { title: "Antarctica", value: "AQ" },+ { title: "Antigua and Barbuda", value: "AG" },+ { title: "Argentina", value: "AR" },+ { title: "Armenia", value: "AM" },+ { title: "Aruba", value: "AW" },+ { title: "Australia", value: "AU" },+ { title: "Austria", value: "AT" },+ { title: "Azerbaijan", value: "AZ" },+ { title: "Bahamas", value: "BS" },+ { title: "Bahrain", value: "BH" },+ { title: "Bangladesh", value: "BD" },+ { title: "Barbados", value: "BB" },+ { title: "Belarus", value: "BY" },+ { title: "Belgium", value: "BE" },+ { title: "Belize", value: "BZ" },+ { title: "Benin", value: "BJ" },+ { title: "Bermuda", value: "BM" },+ { title: "Bhutan", value: "BT" },+ { title: "Bolivia", value: "BO" },+ { title: "Bonaire", value: "BQ" },+ { title: "Bosnia and Herzegovina", value: "BA" },+ { title: "Botswana", value: "BW" },+ { title: "Bouvet Island", value: "BV" },+ { title: "Brazil", value: "BR" },+ { title: "British Indian Ocean", value: "IO" },+ { title: "Brunei Darussalam", value: "BN" },+ { title: "Bulgaria", value: "BG" },+ { title: "Burkina Faso", value: "BF" },+ { title: "Burundi", value: "BI" },+ { title: "Cabo Verde", value: "CV" },+ { title: "Cambodia", value: "KH" },+ { title: "Cameroon", value: "CM" },+ { title: "Canada", value: "CA" },+ { title: "Cayman Islands", value: "KY" },+ { title: "Central African Republic", value: "CF" },+ { title: "Chad", value: "TD" },+ { title: "Chile", value: "CL" },+ { title: "China", value: "CN" },+ { title: "Christmas Island", value: "CX" },+ { title: "Cocos (Keeling) Islands", value: "CC" },+ { title: "Colombia", value: "CO" },+ { title: "Comoros", value: "KM" },+ { title: "Congo", value: "CG" },+ { title: "Congo", value: "CD" },+ { title: "Cook Islands", value: "CK" },+ { title: "Costa Rica", value: "CR" },+ { title: "Côte d'Ivoire", value: "CI" },+ { title: "Cuba", value: "CU" },+ { title: "Curaçao", value: "CW" },+ { title: "Cyprus", value: "CY" },+ { title: "Czechia", value: "CZ" },+ { title: "Denmark", value: "DK" },+ { title: "Djibouti", value: "DJ" },+ { title: "Dominica", value: "DM" },+ { title: "Dominican Republic", value: "DO" },+ { title: "Ecuador", value: "EC" },+ { title: "Egypt", value: "EG" },+ { title: "El Salvador", value: "SV" },+ { title: "Equatorial Guinea", value: "GQ" },+ { title: "Eritrea", value: "ER" },+ { title: "Estonia", value: "EE" },+ { title: "Eswatini", value: "SZ" },+ { title: "Ethiopia", value: "ET" },+ { title: "Falkland Islands", value: "FK" },+ { title: "Faroe Islands", value: "FO" },+ { title: "Fiji", value: "FJ" },+ { title: "Finland", value: "FI" },+ { title: "France", value: "FR" },+ { title: "French Guiana", value: "GF" },+ { title: "French Polynesia", value: "PF" },+ { title: "French Southern Territories", value: "TF" },+ { title: "Gabon", value: "GA" },+ { title: "Gambia", value: "GM" },+ { title: "Georgia", value: "GE" },+ { title: "Germany", value: "DE" },+ { title: "Ghana", value: "GH" },+ { title: "Gibraltar", value: "GI" },+ { title: "Greece", value: "GR" },+ { title: "Greenland", value: "GL" },+ { title: "Grenada", value: "GD" },+ { title: "Guadeloupe", value: "GP" },+ { title: "Guam", value: "GU" },+ { title: "Guatemala", value: "GT" },+ { title: "Guernsey", value: "GG" },+ { title: "Guinea", value: "GN" },+ { title: "Guinea-Bissau", value: "GW" },+ { title: "Guyana", value: "GY" },+ { title: "Haiti", value: "HT" },+ { title: "Heard Island and McDonald Islands", value: "HM" },+ { title: "Holy See", value: "VA" },+ { title: "Honduras", value: "HN" },+ { title: "Hong Kong", value: "HK" },+ { title: "Hungary", value: "HU" },+ { title: "Iceland", value: "IS" },+ { title: "India", value: "IN" },+ { title: "Indonesia", value: "ID" },+ { title: "Iran", value: "IR" },+ { title: "Iraq", value: "IQ" },+ { title: "Ireland", value: "IE" },+ { title: "Isle of Man", value: "IM" },+ { title: "Israel", value: "IL" },+ { title: "Italy", value: "IT" },+ { title: "Jamaica", value: "JM" },+ { title: "Japan", value: "JP" },+ { title: "Jersey", value: "JE" },+ { title: "Jordan", value: "JO" },+ { title: "Kazakhstan", value: "KZ" },+ { title: "Kenya", value: "KE" },+ { title: "Kiribati", value: "KI" },+ { title: "North Korea", value: "KP" },+ { title: "South Korea", value: "KR" },+ { title: "Kuwait", value: "KW" },+ { title: "Kyrgyzstan", value: "KG" },+ { title: "Lao People's Democratic Republic", value: "LA" },+ { title: "Latvia", value: "LV" },+ { title: "Lebanon", value: "LB" },+ { title: "Lesotho", value: "LS" },+ { title: "Liberia", value: "LR" },+ { title: "Libya", value: "LY" },+ { title: "Liechtenstein", value: "LI" },+ { title: "Lithuania", value: "LT" },+ { title: "Luxembourg", value: "LU" },+ { title: "Macao", value: "MO" },+ { title: "Madagascar", value: "MG" },+ { title: "Malawi", value: "MW" },+ { title: "Malaysia", value: "MY" },+ { title: "Maldives", value: "MV" },+ { title: "Mali", value: "ML" },+ { title: "Malta", value: "MT" },+ { title: "Marshall Islands", value: "MH" },+ { title: "Martinique", value: "MQ" },+ { title: "Mauritania", value: "MR" },+ { title: "Mauritius", value: "MU" },+ { title: "Mayotte", value: "YT" },+ { title: "Mexico", value: "MX" },+ { title: "Micronesia", value: "FM" },+ { title: "Moldova", value: "MD" },+ { title: "Monaco", value: "MC" },+ { title: "Mongolia", value: "MN" },+ { title: "Montenegro", value: "ME" },+ { title: "Montserrat", value: "MS" },+ { title: "Morocco", value: "MA" },+ { title: "Mozambique", value: "MZ" },+ { title: "Myanmar", value: "MM" },+ { title: "Namibia", value: "NA" },+ { title: "Nauru", value: "NR" },+ { title: "Nepal", value: "NP" },+ { title: "Netherlands", value: "NL" },+ { title: "New Caledonia", value: "NC" },+ { title: "New Zealand", value: "NZ" },+ { title: "Nicaragua", value: "NI" },+ { title: "Niger", value: "NE" },+ { title: "Nigeria", value: "NG" },+ { title: "Niue", value: "NU" },+ { title: "Norfolk Island", value: "NF" },+ { title: "North Macedonia", value: "MK" },+ { title: "Northern Mariana Islands", value: "MP" },+ { title: "Norway", value: "NO" },+ { title: "Oman", value: "OM" },+ { title: "Pakistan", value: "PK" },+ { title: "Palau", value: "PW" },+ { title: "Panama", value: "PA" },+ { title: "Papua New Guinea", value: "PG" },+ { title: "Paraguay", value: "PY" },+ { title: "Peru", value: "PE" },+ { title: "Philippines", value: "PH" },+ { title: "Pitcairn", value: "PN" },+ { title: "Poland", value: "PL" },+ { title: "Portugal", value: "PT" },+ { title: "Puerto Rico", value: "PR" },+ { title: "Qatar", value: "QA" },+ { title: "Réunion", value: "RE" },+ { title: "Romania", value: "RO" },+ { title: "Russian Federation", value: "RU" },+ { title: "Rwanda", value: "RW" },+ { title: "Saint Barthélemy", value: "BL" },+ { title: "Saint Helena, Ascension and Tristan da Cunha", value: "SH" },+ { title: "Saint Kitts and Nevis", value: "KN" },+ { title: "Saint Lucia", value: "LC" },+ { title: "Saint Martin (French part)", value: "MF" },+ { title: "Saint Pierre and Miquelon", value: "PM" },+ { title: "Saint Vincent and the Grenadines", value: "VC" },+ { title: "Samoa", value: "WS" },+ { title: "San Marino", value: "SM" },+ { title: "Sao Tome and Principe", value: "ST" },+ { title: "Saudi Arabia", value: "SA" },+ { title: "Senegal", value: "SN" },+ { title: "Serbia", value: "RS" },+ { title: "Seychelles", value: "SC" },+ { title: "Sierra Leone", value: "SL" },+ { title: "Singapore", value: "SG" },+ { title: "Slovakia", value: "SK" },+ { title: "Slovenia", value: "SI" },+ { title: "Solomon Islands", value: "SB" },+ { title: "Somalia", value: "SO" },+ { title: "South Africa", value: "ZA" },+ { title: "South Georgia and the South Sandwich Islands", value: "GS" },+ { title: "South Sudan", value: "SS" },+ { title: "Spain", value: "ES" },+ { title: "Sri Lanka", value: "LK" },+ { title: "Sudan", value: "SD" },+ { title: "Suriname", value: "SR" },+ { title: "Svalbard and Jan Mayen", value: "SJ" },+ { title: "Sweden", value: "SE" },+ { title: "Switzerland", value: "CH" },+ { title: "Syrian Arab Republic", value: "SY" },+ { title: "Taiwan, Province of China", value: "TW" },+ { title: "Tajikistan", value: "TJ" },+ { title: "Tanzania, United Republic of", value: "TZ" },+ { title: "Thailand", value: "TH" },+ { title: "Timor-Leste", value: "TL" },+ { title: "Togo", value: "TG" },+ { title: "Tokelau", value: "TK" },+ { title: "Tonga", value: "TO" },+ { title: "Trinidad and Tobago", value: "TT" },+ { title: "Tunisia", value: "TN" },+ { title: "Turkey", value: "TR" },+ { title: "Turkmenistan", value: "TM" },+ { title: "Turks and Caicos Islands", value: "TC" },+ { title: "Tuvalu", value: "TV" },+ { title: "Uganda", value: "UG" },+ { title: "Ukraine", value: "UA" },+ { title: "United Arab Emirates", value: "AE" },+ { title: "United Kingdom", value: "GB" },+ { title: "United States", value: "US" },+ { title: "United States Minor Outlying Islands", value: "UM" },+ { title: "Uruguay", value: "UY" },+ { title: "Uzbekistan", value: "UZ" },+ { title: "Vanuatu", value: "VU" },+ { title: "Venezuela", value: "VE" },+ { title: "Viet Nam", value: "VN" },+ { title: "Virgin Islands (British)", value: "VG" },+ { title: "Virgin Islands (U.S.)", value: "VI" },+ { title: "Wallis and Futuna", value: "WF" },+ { title: "Western Sahara", value: "EH" },+ { title: "Yemen", value: "YE" },+ { title: "Zambia", value: "ZM" },+ { title: "Zimbabwe", value: "ZW" },+];++const usStates: SelectOption[] = [+ { title: "Alabama", value: "AL" },+ { title: "Alaska", value: "AK" },+ { title: "Arizona", value: "AZ" },+ { title: "Arkansas", value: "AR" },+ { title: "California", value: "CA" },+ { title: "Colorado", value: "CO" },+ { title: "Connecticut", value: "CT" },+ { title: "Delaware", value: "DE" },+ { title: "Florida", value: "FL" },+ { title: "Georgia", value: "GA" },+ { title: "Hawaii", value: "HI" },+ { title: "Idaho", value: "ID" },+ { title: "Illinois", value: "IL" },+ { title: "Indiana", value: "IN" },+ { title: "Iowa", value: "IA" },+ { title: "Kansas", value: "KS" },+ { title: "Kentucky", value: "KY" },+ { title: "Louisiana", value: "LA" },+ { title: "Maine", value: "ME" },+ { title: "Maryland", value: "MD" },+ { title: "Massachusetts", value: "MA" },+ { title: "Michigan", value: "MI" },+ { title: "Minnesota", value: "MN" },+ { title: "Mississippi", value: "MS" },+ { title: "Missouri", value: "MO" },+ { title: "Montana", value: "MT" },+ { title: "Nebraska", value: "NE" },+ { title: "Nevada", value: "NV" },+ { title: "New Hampshire", value: "NH" },+ { title: "New Jersey", value: "NJ" },+ { title: "New Mexico", value: "NM" },+ { title: "New York", value: "NY" },+ { title: "North Carolina", value: "NC" },+ { title: "North Dakota", value: "ND" },+ { title: "Ohio", value: "OH" },+ { title: "Oklahoma", value: "OK" },+ { title: "Oregon", value: "OR" },+ { title: "Pennsylvania", value: "PA" },+ { title: "Rhode Island", value: "RI" },+ { title: "South Carolina", value: "SC" },+ { title: "South Dakota", value: "SD" },+ { title: "Tennessee", value: "TN" },+ { title: "Texas", value: "TX" },+ { title: "Utah", value: "UT" },+ { title: "Vermont", value: "VT" },+ { title: "Virginia", value: "VA" },+ { title: "Washington", value: "WA" },+ { title: "West Virginia", value: "WV" },+ { title: "Wisconsin", value: "WI" },+ { title: "Wyoming", value: "WY" },+ { title: "District of Columbia", value: "DC" },+];++const canadaProvinces: SelectOption[] = [+ { title: "Alberta", value: "AB" },+ { title: "British Columbia", value: "BC" },+ { title: "Manitoba", value: "MB" },+ { title: "New Brunswick", value: "NB" },+ { title: "Newfoundland and Labrador", value: "NL" },+ { title: "Nova Scotia", value: "NS" },+ { title: "Ontario", value: "ON" },+ { title: "Prince Edward Island", value: "PE" },+ { title: "Quebec", value: "QC" },+ { title: "Saskatchewan", value: "SK" },+ { title: "Northwest Territories", value: "NT" },+ { title: "Nunavut", value: "NU" },+ { title: "Yukon", value: "YT" },+];++export function getStateOptions(country: string): SelectOption[] {+ if (country === "US") {+ return usStates;+ }+ if (country === "CA") {+ return canadaProvinces;+ }+ return [];+}++export default countries;