()
| 26 | } |
| 27 | |
| 28 | function Dashboard() { |
| 29 | const { profile } = useProfile(); |
| 30 | // The cloud version of the app is priced based on number of user queries. |
| 31 | // The self-hosted version will cost per request to openai |
| 32 | if ( |
| 33 | process.env.NEXT_PUBLIC_IS_IN_CLOUD && |
| 34 | process.env.NEXT_PUBLIC_IS_IN_CLOUD === "true" |
| 35 | ) { |
| 36 | // If premium, show usage in queries |
| 37 | if ( |
| 38 | process.env.NODE_ENV === "development" || |
| 39 | profile?.organizations?.is_paid[0]?.is_premium |
| 40 | ) { |
| 41 | return <DashboardNumMessages />; |
| 42 | } else { |
| 43 | // Otherwise show upgrade message |
| 44 | return ( |
| 45 | <div className="flex flex-col items-center justify-center min-h-screen"> |
| 46 | <Navbar current={"Usage"} /> |
| 47 | <main className="flex flex-col items-center justify-start py-20 flex-1 px-20 text-center bg-gray-800 w-screen h-screen"> |
| 48 | <div className="bg-gray-850 rounded-md px-20 lg:px-40 py-10"> |
| 49 | <h1 className="text-4xl text-gray-200 font-medium"> |
| 50 | Upgrade to see usage |
| 51 | </h1> |
| 52 | <p className="mt-2 text-xl text-gray-400"> |
| 53 | View{" "} |
| 54 | <a |
| 55 | href="https://superflows.ai/pricing" |
| 56 | className="text-blue-600 hover:underline" |
| 57 | > |
| 58 | pricing page |
| 59 | </a> |
| 60 | </p> |
| 61 | </div> |
| 62 | </main> |
| 63 | </div> |
| 64 | ); |
| 65 | } |
| 66 | } |
| 67 | return <DashboardCost />; |
| 68 | } |
| 69 | |
| 70 | const formatDate = timeFormat("%Y-%m-%d"); |
| 71 |
nothing calls this directly
no test coverage detected