From 7f0f78dfe7c826ff4d80821b4ce28a600418c825 Mon Sep 17 00:00:00 2001 From: Anton Wyrowski Date: Tue, 9 Jul 2024 10:55:04 +0200 Subject: [PATCH] feat: removed lib from gitignore --- .gitignore | 1 - frontend/lib/image-classification.types.ts | 40 ++++++++++++++++++++++ frontend/lib/utils.ts | 6 ++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 frontend/lib/image-classification.types.ts create mode 100644 frontend/lib/utils.ts 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)) +}