import streamlit as st
import pandas as pd
import sqlite3
import os
from datetime import datetime
import time
# Page config
st.set_page_config(
page_title="Cold Email Assistant - Premium Demo",
page_icon="๐ง",
layout="wide"
)
# Import components
try:
from scraper import scrape_company_info
SCRAPER_AVAILABLE = True
except ImportError as e:
print(f"โ ๏ธ Scraper not available: {e}")
SCRAPER_AVAILABLE = False
def scrape_company_info(url_or_company):
return "Company research feature requires additional setup. Please contact support for enterprise features."
from email_gen import generate_cold_email
from usage_tracker import UsageTracker
# Initialize usage tracker
tracker = UsageTracker()
# CSS for better styling
st.markdown("""
""", unsafe_allow_html=True)
# Header with premium badge and urgency
st.markdown("""
๐ Cold Email Assistant - Premium Demo
โจ You're experiencing $97/month features for FREE โข Limited daily usage
๐ฅ ALL PREMIUM FEATURES UNLOCKED
""", unsafe_allow_html=True)
# Add urgency banner
usage_percent = (tracker.get_emails_generated() / tracker.daily_email_limit) * 100
if usage_percent > 70:
st.error(f"โ ๏ธ **{100-usage_percent:.0f}% of daily quota remaining** - Upgrade now to avoid interruption!")
elif usage_percent > 40:
st.warning(f"๐ **{100-usage_percent:.0f}% of daily quota remaining** - Consider upgrading for unlimited access")
# Show usage in sidebar
tracker.show_usage_sidebar()
# Sidebar with user info
st.sidebar.title("๐ Navigation")
page = st.sidebar.selectbox("Choose a page", ["๐ฏ Generate Emails", "๐ Bulk Processing", "๐ Analytics Preview"])
# Sender Information
st.sidebar.markdown("---")
st.sidebar.subheader("๐ค Your Information")
sender_name = st.sidebar.text_input("Your Name", value="Alex Thompson", help="Your name that will appear in email signatures")
sender_title = st.sidebar.text_input("Your Title (Optional)", value="", placeholder="e.g., Sales Director", help="Your job title (optional)")
sender_company = st.sidebar.text_input("Your Company (Optional)", value="", placeholder="e.g., TechSolutions Inc.", help="Your company name (optional)")
# Create sender signature
if sender_title and sender_company:
sender_signature = f"{sender_name}\n{sender_title}, {sender_company}"
elif sender_title:
sender_signature = f"{sender_name}\n{sender_title}"
else:
sender_signature = sender_name
if page == "๐ฏ Generate Emails":
st.header("๐ฏ Premium Email Generation")
# Check if user can generate emails
if not tracker.can_generate_email():
st.error("๐ซ **Daily limit reached!** You've experienced the premium features.")
col1, col2 = st.columns([2, 1])
with col1:
st.markdown("""
### ๐ฏ What you experienced today:
- โ
AI-powered email generation (normally $97/month)
- โ
Company research automation (saves 2+ hours/day)
- โ
Industry-specific templates (10x better conversion)
- โ
Premium quality scoring (proven to increase responses)
""")
with col2:
st.markdown("""
### ๐ฐ Your ROI Calculation:
**Time saved:** 2 hours ร $50/hour = **$100/day**
**Responses gained:** +40% = **$500+ in deals**
**Tool cost:** Only $19 one-time
**ROI:** 2,500%+ ๐
""")
st.markdown("""
๐ Ready for Unlimited Access?
You've experienced the premium features - now get unlimited access!
โ
Unlimited emails โ
Unlimited research โ
Advanced analytics โ
Priority support
Get Lifetime Access for $19 โ
""", unsafe_allow_html=True)