Skip to content

Commit

Permalink
fix various missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
sangdth committed Dec 15, 2023
1 parent 20c62c3 commit 45711b9
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 21 deletions.
28 changes: 16 additions & 12 deletions icons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
'use client';

import { Icon, IconProps as P } from '@/components/chakra';

import {
MdBarChart,
MdBusiness,
MdDashboard,
MdOutlineWorkspacePremium as MdPremium,
MdFormatListBulleted,
MdDataExploration,
MdFilterAlt,
MdFlag,
MdFormatBold,
MdFormatItalic,
MdFlashOn,
MdFormatListBulleted,
MdInsertChart,
MdLogout,
MdFormatBold,
MdStarBorder,
MdDashboard,
MdFilterAlt,
MdBarChart,
MdBusiness,
MdFlashOn,
MdPalette,
MdPreview,
MdLogout,
MdFlag,
MdSave,
MdStar,
MdStarBorder,
} from 'react-icons/md';
import { LuRefreshCw, LuStickyNote } from 'react-icons/lu';
import { DiGoogleCloudPlatform } from 'react-icons/di';
import { FaGithub, FaGlobe } from 'react-icons/fa6';
import { BiSolidCommentAdd } from 'react-icons/bi';
import { TbBrandTypescript } from 'react-icons/tb';
import { FaAws, FaGoogle } from 'react-icons/fa';
import { AiOutlineEnter } from 'react-icons/ai';
import { TbBrandNextjs } from 'react-icons/tb';
import { BsThreeDots } from 'react-icons/bs';
import { SiChakraui } from 'react-icons/si';
import { FcFlashOn } from 'react-icons/fc';
import { SiPrisma } from 'react-icons/si';
import { HiUsers } from 'react-icons/hi2';
import { FaAws } from 'react-icons/fa';

export * from '@chakra-ui/icons';

// Company logos, for demo
export const AwsLogo = (p: P) => <Icon as={FaAws} {...p} />;
export const ChakraLogo = (p: P) => <Icon as={SiChakraui} {...p} />;
export const GcpLogo = (p: P) => <Icon as={DiGoogleCloudPlatform} {...p} />;
export const GoogleLogo = (p: P) => <Icon as={FaGoogle} {...p} />;
export const NextLogo = (p: P) => <Icon as={TbBrandNextjs} {...p} />;
export const ChakraLogo = (p: P) => <Icon as={SiChakraui} {...p} />;
export const PrismaLogo = (p: P) => <Icon as={SiPrisma} {...p} />;
export const TypescriptLogo = (p: P) => <Icon as={TbBrandTypescript} {...p} />;

Expand Down Expand Up @@ -70,3 +73,4 @@ export const StarIcon = (p: P) => <Icon as={MdStar} {...p} />;
export const StickyNoteIcon = (p: P) => <Icon as={LuStickyNote} {...p} />;
export const ThreeDotsIcon = (p: P) => <Icon as={BsThreeDots} {...p} />;
export const UsersIcon = (p: P) => <Icon as={HiUsers} {...p} />;
export const PremiumIcon = (p: P) => <Icon as={MdPremium} color="yellow" {...p} />;
76 changes: 76 additions & 0 deletions lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Plan } from '@/types';

export const STRIPE_API_VERSION = '2023-10-16';
export const STRIPE_APP_NAME = 'Sieutoc Platform';
export const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;
Expand All @@ -12,3 +14,77 @@ export const EMAIL_REGEX =

export const ROW_HEIGHT = 53;
export const MAX_PROJECTS = Number(process.env.MAX_PROJECTS ?? 1);

export const LISTMONK_API = process.env.LISTMONK_API ?? '';
export const LISTMONK_SECRET = `${process.env.LISTMONK_ADMIN_USERNAME}:${process.env.LISTMONK_ADMIN_PASSWORD}`;

export const RESERVED_SLUGS = ['sang', 'aiei'];

type Pricing = {
price: {
monthly: number | string;
yearly: number | string;
};
description?: string;
ctaText?: string;
features: string[];
quota: {
projects: number;
rows: number;
};
};

export const FEATURES: Record<keyof typeof Plan, Pricing> = {
[Plan.HOBBY]: {
price: {
monthly: 9,
yearly: 5,
},
description: 'Unlock key features and higher usage limits',
features: [
'Up to 3 team members',
'Up to 3 projects',
'Intuitive, fast and privacy-friendly dashboard',
],
quota: {
projects: 3,
rows: 10,
},
},
[Plan.PRO]: {
price: {
monthly: 62,
yearly: 59,
},
description: 'Enjoy higher limits and extra features with our Pro plan.',
features: [
`Everything in ${Plan.HOBBY}`,
'Up to 10 team members',
'Up to 10 projects',
'Lorem ipsum plan dono',
'Something else longer so it will make two lines',
],
quota: {
projects: 10,
rows: 100,
},
},
[Plan.ENTERPRISE]: {
price: {
monthly: 'Custom',
yearly: 'Custom',
},
description: 'Elevate with exclusive features and limitless potential.',
ctaText: 'Contact Us',
features: [
`Everything in ${Plan.PRO}`,
'Unlimited team members',
'Unlimited projects',
'Technical onboarding',
],
quota: {
projects: 999,
rows: 1000,
},
},
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"ai": "2.2.29",
"date-fns": "2.30.0",
"deepmerge": "4.3.1",
"easypanel-sdk": "0.3.1",
"easypanel.js": "1.1.6",
"fast-deep-equal": "3.1.3",
"framer-motion": "10.16.16",
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ enum UserRole {
USER
}

enum Plan {
HOBBY
PRO
ENTERPRISE
}

model User {
id String @id @default(uuid())
name String?
Expand Down Expand Up @@ -82,5 +88,6 @@ model Project {
updatedAt DateTime @updatedAt
environmentVariables Json @default("{\"preview\":{},\"production\":{}}")
template String?
plan Plan @default(HOBBY)
users User[]
}
15 changes: 15 additions & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ export enum HttpMethod {
TRACE = 'TRACE',
}

// For Listmonk
export type SubscribeResponse = {
data: {
id: number;
created_at: string;
updated_at: string;
uuid: string;
email: string;
name: string;
attribs: Record<string, unknown>;
status: 'enabled' | 'disabled' | 'blocklisted';
lists: number[];
};
};

export type JsonObject = Prisma.JsonObject;

export type ReposResponse = Endpoints['GET /repos/{owner}/{repo}']['response'];
Expand Down

0 comments on commit 45711b9

Please sign in to comment.