export type StrapiSharedMetaData = {
	id: number;
	documentId: string;
	createdAt: string;
	updatedAt: string;
	publishedAt: string;
};

export type StrapiImageFormat = {
	ext: string;
	url: string;
	hash: string;
	mime: string;
	name: string;
	path: string;
	size: number;
	width: number;
	height: number;
	sizeInBytes: number;
};

export type StrapiImage = {
	alternativeText: string;
	caption: string;
	focalPoint: object;
	formats: {
		small: StrapiImageFormat;
		medium: StrapiImageFormat;
		thumbnail: StrapiImageFormat;
	};
	previewUrl: string;
	provider: string;
	provider_metadata: object;
} & StrapiSharedMetaData &
	Omit<StrapiImageFormat, 'path' | 'sizeInBytes'>;

export type StrapiHomepageResponse = {
	data: StrapiHomepage;
	meta: object;
};

export type StrapiHomepage = {
	title: string;
	components: StrapiComponentUnion[];
} & StrapiSharedMetaData;

export interface StrapiProfileComponent {
	__component: 'shared.profile';
	id: number;
	profile: StrapiProfile;
}

export interface StrapiProjectComponent {
	__component: 'shared.project';
	id: number;
	project: StrapiProject;
}

export interface StrapiSkillComponent {
	__component: 'shared.skill';
	id: number;
	skill: StrapiSkill;
}

export interface StrapiContactComponent {
	__component: 'shared.contact';
	id: number;
	contact: StrapiContact;
}

export type StrapiComponentUnion =
	| StrapiProfileComponent
	| StrapiProjectComponent
	| StrapiSkillComponent
	| StrapiContactComponent;

export type ComponentKeys = StrapiComponentUnion['__component'];

export type StrapiProfile = {
	name: string;
	title: string;
	description: string;
	anchor_id: string;
	image: StrapiImage;
} & StrapiSharedMetaData;

export type StrapiProject = {
	title: string;
	subtitle: string;
	anchor_id: string;
	entries: StrapiProjectEntry[];
} & StrapiSharedMetaData;

export type StrapiProjectEntry = {
	front_title: string;
	front_description: string;
	back_title: string;
	back_description: string;
	back_title_second: string;
	back_content_list: string[];
} & StrapiSharedMetaData;

export type StrapiSkill = {
	title: string;
	subtitle: string;
	anchor_id: string;
	entries: StrapiSkillEntry[];
} & StrapiSharedMetaData;

export type StrapiSkillEntry = {
	title: string;
	icon: string;
	content: string[];
} & StrapiSharedMetaData;

export type StrapiContact = {
	title: string;
	subtitle: string;
	form_title: string;
	subject_placeholder: string;
	message_placeholder: string;
	cta_text: string;
	anchor_id: string;
} & StrapiSharedMetaData;

export type StrapiFooterResponse = {
	data: StrapiFooter;
	meta: object;
};

export type StrapiFooter = {
	copyright: string;
	linkedin: string;
	git: string;
} & StrapiSharedMetaData;