From 3fd769a36f89a2f1203e64a26a1f36227b1ab39c Mon Sep 17 00:00:00 2001
From: shafi54 <108669266+shafi-aviz@users.noreply.github.com>
Date: Sat, 23 May 2026 16:39:23 +0530
Subject: [PATCH] common components extraction.
---
.../src/components/ui/BackLink.tsx | 19 +++++++
.../src/components/ui/DetailRow.tsx | 29 ++++++++++
.../src/components/ui/EmptyState.tsx | 38 +++++++++++++
.../src/components/ui/FormField.tsx | 29 ++++++++++
.../src/components/ui/SearchToolbar.tsx | 38 +++++++++++++
apps/pharmanager/src/components/ui/index.ts | 9 ++-
.../src/routes/distributors/index.tsx | 30 +++-------
apps/pharmanager/src/routes/products/$id.tsx | 57 ++++---------------
.../pharmanager/src/routes/products/index.tsx | 30 +++-------
apps/pharmanager/src/routes/stock/$id.tsx | 35 ++++--------
apps/pharmanager/src/routes/stock/index.tsx | 27 +++------
apps/pharmanager/src/routes/storage/index.tsx | 30 +++-------
12 files changed, 218 insertions(+), 153 deletions(-)
create mode 100644 apps/pharmanager/src/components/ui/BackLink.tsx
create mode 100644 apps/pharmanager/src/components/ui/DetailRow.tsx
create mode 100644 apps/pharmanager/src/components/ui/EmptyState.tsx
create mode 100644 apps/pharmanager/src/components/ui/FormField.tsx
create mode 100644 apps/pharmanager/src/components/ui/SearchToolbar.tsx
diff --git a/apps/pharmanager/src/components/ui/BackLink.tsx b/apps/pharmanager/src/components/ui/BackLink.tsx
new file mode 100644
index 0000000..fddbcf5
--- /dev/null
+++ b/apps/pharmanager/src/components/ui/BackLink.tsx
@@ -0,0 +1,19 @@
+import { Link } from "@tanstack/react-router";
+import { ArrowLeft } from "lucide-react";
+
+interface BackLinkProps {
+ to: string;
+ label: string;
+}
+
+export function BackLink({ to, label }: BackLinkProps) {
+ return (
+
+
{description}
+ {actionLabel && actionTo && ( + + {actionLabel} + + )} +{error}
} +The product you're looking for doesn't exist.
- - Back to Products - -The batch you're looking for doesn't exist.
- - Back to Stock - -