diff --git a/.gitignore b/.gitignore index 4227733..934ac62 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ dist/ downloads/ eggs/ .eggs/ -lib/ lib64/ parts/ sdist/ diff --git a/frontend/lib/image-classification.types.ts b/frontend/lib/image-classification.types.ts new file mode 100644 index 0000000..b409e56 --- /dev/null +++ b/frontend/lib/image-classification.types.ts @@ -0,0 +1,40 @@ +type ClassificationDataType = { + unknown: any; + 'model-producer': { + model: string; + producer: string; + }; + 'producer-url': { + title: string; + link: string; + }; + 'retail-price-details': { + producer_url: string; + price: number; + original_name: string; + description: string; + material: string; + specs: string; + }; + 'estimated-price': { + price: number; + certainty: string; + min_range: number; + max_range: number; + }; + 'second-hand-offers': { + link: string; + price: number; + wear: string; + }[]; +}; + +export type ClassificationProductDescription = keyof ClassificationDataType; + +export type ClassificationProduct< + T extends ClassificationProductDescription = ClassificationProductDescription +> = { + data: ClassificationDataType[T]; + data_description: T; + data_type: string; +}; diff --git a/frontend/lib/utils.ts b/frontend/lib/utils.ts new file mode 100644 index 0000000..d084cca --- /dev/null +++ b/frontend/lib/utils.ts @@ -0,0 +1,6 @@ +import { type ClassValue, clsx } from "clsx" +import { twMerge } from "tailwind-merge" + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)) +}