-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): Minimalize onboarding and nav (#141)
- Loading branch information
Showing
42 changed files
with
572 additions
and
590 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { type Metadata } from "next" | ||
|
||
import Navbar from "@/components/nav/navbar" | ||
import { WorkflowProvider } from "@/providers/workflow" | ||
|
||
export const metadata: Metadata = { | ||
title: "Playbooks", | ||
description: "Pre-built workflows ready to deploy." | ||
} | ||
|
||
export default async function WorkflowsLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<WorkflowProvider> | ||
<div className="no-scrollbar flex h-screen max-h-screen flex-col"> | ||
<Navbar /> | ||
{children} | ||
</div> | ||
</WorkflowProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Loader2 } from "lucide-react" | ||
|
||
export default function Loading() { | ||
return ( | ||
<div className="container flex h-full max-w-[800px] flex-col justify-center space-y-2 p-16"> | ||
<Loader2 className="mx-auto animate-spin text-gray-500" /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react" | ||
|
||
import { WorkflowsDashboard } from "@/components/playbooks/workflows-dashboard" | ||
|
||
export default async function Page() { | ||
return <WorkflowsDashboard /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
frontend/src/components/dashboard/create-workflow-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"use client" | ||
|
||
import { useRouter } from "next/navigation"; | ||
import { PlusCircleIcon } from "lucide-react"; | ||
|
||
import { createWorkflow } from "@/lib/flow"; | ||
import { Button } from "@/components/ui/button"; | ||
import { toast } from "@/components/ui/use-toast"; | ||
|
||
const CreateWorkflowButton: React.FC = () => { | ||
const router = useRouter(); | ||
|
||
const handleCreateWorkflow = async () => { | ||
try { | ||
// Get the current date and format it | ||
const currentDate = new Date(); | ||
const formattedDate = currentDate.toLocaleString('en-US', { | ||
month: 'short', | ||
day: '2-digit', | ||
year: 'numeric', | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
second: '2-digit', | ||
hour12: false, | ||
}); | ||
const title = `${formattedDate}`; | ||
const description = `New workflow created ${formattedDate}.`; | ||
|
||
const response = await createWorkflow(title, description); | ||
|
||
toast({ | ||
title: title, | ||
description: description, | ||
}); | ||
|
||
// Redirect to the new workflow's page | ||
router.push(`/workflows/${response.id}`); | ||
} catch (error) { | ||
console.error("Error adding workflow:", error); | ||
} | ||
}; | ||
|
||
return ( | ||
<Button | ||
variant="outline" | ||
role="combobox" | ||
className="space-x-2" | ||
onClick={handleCreateWorkflow} | ||
> | ||
<PlusCircleIcon className="h-4 w-4" /> | ||
<span>New workflow</span> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default CreateWorkflowButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.