-
{commitChanges}
+
+ {isEditMode ? (
+
+ ) : (
+
+
{commitChanges}
+
+
+ )}
);
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index 225e113..032560c 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -24,7 +24,7 @@ const buttonVariants = cva(
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
- icon: "h-9 w-9",
+ icon: "h-8 w-8",
},
},
defaultVariants: {
From 6ac1263bd9ea82ad3fb14447bc4baec831b1831f Mon Sep 17 00:00:00 2001
From: ruru <142723369+ruru-m07@users.noreply.github.com>
Date: Sat, 18 May 2024 19:08:43 +0530
Subject: [PATCH 2/2] refactor: format code
---
app/layout.tsx | 7 ++++---
app/page.tsx | 8 ++++----
components/emptyScreen.tsx | 20 +++++++++++---------
components/listSuggestion.tsx | 2 +-
components/md-components.tsx | 20 ++++++++++----------
components/md/copy-button.tsx | 5 +----
components/ui/dialog.tsx | 10 +++++-----
components/ui/toast.tsx | 3 +--
8 files changed, 37 insertions(+), 38 deletions(-)
diff --git a/app/layout.tsx b/app/layout.tsx
index e782031..989f034 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -69,8 +69,9 @@ export default function RootLayout({
buttonVariants({
variant: "outline",
size: "icon",
- className: "rounded-full w-10 h-10 overflow-hidden sm:block hidden",
- })
+ className:
+ "rounded-full w-10 h-10 overflow-hidden sm:block hidden",
+ }),
)}
>
diff --git a/app/page.tsx b/app/page.tsx
index 0fb1c2c..eb25a1f 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -27,7 +27,7 @@ export default function Home() {
const [error, setError] = React.useState(null);
const [commitChanges, setcommitChanges] = React.useState(null);
const [commitMessages, setcommitMessages] = React.useState(
- null
+ null,
);
const { toast } = useToast();
@@ -62,7 +62,7 @@ export default function Home() {
toastVariants({
variant: "destructive",
className: "w-fit m-0 p-2 text-xs hover:bg-[#815305]/35",
- })
+ }),
)}
onClick={() => handelSubmit({ suggestion })}
>
@@ -86,7 +86,7 @@ export default function Home() {
const submitForm = (
e: React.FormEvent,
- message: string | null
+ message: string | null,
): void => {
e.preventDefault();
handelSubmit({ suggestion: message || "" });
@@ -154,7 +154,7 @@ export default function Home() {
disabled={isLoading}
>
{isLoading && }
- Generate
+ Generate
diff --git a/components/emptyScreen.tsx b/components/emptyScreen.tsx
index bc46eb6..874252b 100644
--- a/components/emptyScreen.tsx
+++ b/components/emptyScreen.tsx
@@ -43,15 +43,17 @@ const EmptyScreen = ({
{randomMessage}
- {randomSuggestions.slice(0, suggestionCount).map((suggestion, index) => (
-
onSubmit({ suggestion })}
- >
- {suggestion}
-
- ))}
+ {randomSuggestions
+ .slice(0, suggestionCount)
+ .map((suggestion, index) => (
+
onSubmit({ suggestion })}
+ >
+ {suggestion}
+
+ ))}