From 53b7c487a53bfff4a9917c74212804cd447e7df2 Mon Sep 17 00:00:00 2001 From: dbahiense Date: Thu, 25 Jul 2024 13:48:57 -0300 Subject: [PATCH] create types file --- types/index.ts | 129 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 types/index.ts diff --git a/types/index.ts b/types/index.ts new file mode 100644 index 0000000..be6820c --- /dev/null +++ b/types/index.ts @@ -0,0 +1,129 @@ +/* eslint-disable no-unused-vars */ + +import { Dispatch, SetStateAction } from "react"; + +import { Id } from "@/convex/_generated/dataModel"; + +export interface EmptyStateProps { + title: string; + search?: boolean; + buttonText?: string; + buttonLink?: string; +} + +export interface TopPodcastersProps { + _id: Id<"users">; + _creationTime: number; + email: string; + imageUrl: string; + clerkId: string; + name: string; + podcast: { + podcastTitle: string; + podcastId: Id<"podcasts">; + }[]; + totalPodcasts: number; +} + +export interface PodcastProps { + _id: Id<"podcasts">; + _creationTime: number; + audioStorageId: Id<"_storage"> | null; + user: Id<"users">; + podcastTitle: string; + podcastDescription: string; + audioUrl: string | null; + imageUrl: string | null; + imageStorageId: Id<"_storage"> | null; + author: string; + authorId: string; + authorImageUrl: string; + voicePrompt: string; + imagePrompt: string | null; + voiceType: string; + audioDuration: number; + views: number; +} + +export interface ProfilePodcastProps { + podcasts: PodcastProps[]; + listeners: number; +} + +export interface GeneratePodcastProps { + voiceType: string; + setAudio: Dispatch>; + audio: string; + setAudioStorageId: Dispatch | null>>; + voicePrompt: string; + setVoicePrompt: Dispatch>; + setAudioDuration: Dispatch>; +} + +export interface GenerateThumbnailProps { + setImage: Dispatch>; + setImageStorageId: Dispatch | null>>; + image: string; + imagePrompt: string; + setImagePrompt: Dispatch>; +} + +export interface LatestPodcastCardProps { + imgUrl: string; + title: string; + duration: string; + index: number; + audioUrl: string; + author: string; + views: number; + podcastId: Id<"podcasts">; +} + +export interface PodcastDetailPlayerProps { + audioUrl: string; + podcastTitle: string; + author: string; + isOwner: boolean; + imageUrl: string; + podcastId: Id<"podcasts">; + imageStorageId: Id<"_storage">; + audioStorageId: Id<"_storage">; + authorImageUrl: string; + authorId: string; +} + +export interface AudioProps { + title: string; + audioUrl: string; + author: string; + imageUrl: string; + podcastId: string; +} + +export interface AudioContextType { + audio: AudioProps | undefined; + setAudio: React.Dispatch>; +} + +export interface PodcastCardProps { + imgUrl: string; + title: string; + description: string; + podcastId: Id<"podcasts">; +} + +export interface CarouselProps { + fansLikeDetail: TopPodcastersProps[]; +} + +export interface ProfileCardProps { + podcastData: ProfilePodcastProps; + imageUrl: string; + userFirstName: string; +} + +export type UseDotButtonType = { + selectedIndex: number; + scrollSnaps: number[]; + onDotButtonClick: (index: number) => void; +}; \ No newline at end of file