Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/project #18

Open
wants to merge 158 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
19db2dd
added landing page
amandal-cn Sep 3, 2024
9e42d96
added landing page and dashboard
amandal-cn Sep 3, 2024
6f4b79a
added project overview input form
amandal-cn Sep 4, 2024
5cd4972
added header
amandal-cn Sep 4, 2024
6374b6f
Add projects crud
aprusty-cn Sep 4, 2024
d8505ba
added workspace
amandal-cn Sep 5, 2024
171eaf3
improved the look of the artifact list
amandal-cn Sep 5, 2024
aebac39
integrated codeeditor with the workspace
amandal-cn Sep 5, 2024
2314f08
updated main page
amandal-cn Sep 6, 2024
8551969
Merge branch 'apis' of https://github.com/trilogy-group/llamacoder in…
aprusty-cn Sep 6, 2024
d4ef840
Merge
aprusty-cn Sep 6, 2024
4bd4a15
improved the chat interface
amandal-cn Sep 6, 2024
fc384bc
refactored UpdateArtifact
amandal-cn Sep 6, 2024
3e450c9
Add routing between pages
aprusty-cn Sep 6, 2024
a1887dd
Add my projects button
aprusty-cn Sep 6, 2024
cef21fb
added chat context and support viewing attachments
amandal-cn Sep 6, 2024
b260298
improved the file viewer modal's look
amandal-cn Sep 6, 2024
19dc802
fixed the attachment click issue (was sending message)
amandal-cn Sep 6, 2024
13fab2a
show error message on sending empty message
amandal-cn Sep 6, 2024
9bb7fa7
fixed height issue for chat context
amandal-cn Sep 6, 2024
b0fc270
Added the copy buttons over hovered message
amandal-cn Sep 6, 2024
ccf996f
added border color to differentiate between user and assistant messages
amandal-cn Sep 6, 2024
84ba94a
Add create project fucntionality
aprusty-cn Sep 6, 2024
8e0f555
Add loading indicators in dashboard
aprusty-cn Sep 6, 2024
30c77d8
Support delete and status
aprusty-cn Sep 6, 2024
718dc75
Add project title
aprusty-cn Sep 9, 2024
e9ad274
Style changes
aprusty-cn Sep 9, 2024
d879c8a
Add simple landing page with login/signup + routing
rishabh-ti Sep 6, 2024
81bbd0b
removed deprecated config for rendering images
rishabh-ti Sep 6, 2024
49ac6c4
Add FGA client
rishabh-ti Sep 9, 2024
10187b7
Functionality updates
aprusty-cn Sep 9, 2024
80abca4
remove auth buttons from old header
rishabh-ti Sep 9, 2024
3f77196
Merge conflicts
aprusty-cn Sep 9, 2024
be58be8
Add FGA API
rishabh-ti Sep 9, 2024
948be8c
added context and dispatch event functionality
amandal-cn Sep 9, 2024
c1e41ee
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 9, 2024
7efe25b
Fix listObjects & add test page
rishabh-ti Sep 9, 2024
6369a27
Add project authz
aprusty-cn Sep 9, 2024
c89352d
Handle authz errors in the frontend
aprusty-cn Sep 9, 2024
982147a
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 9, 2024
c7b2974
fixed merge issues
amandal-cn Sep 9, 2024
ec92348
Fix ts errors
aprusty-cn Sep 9, 2024
eca0d92
fixed layout issue
amandal-cn Sep 9, 2024
8aec5ef
integrate project crud with its api client
amandal-cn Sep 9, 2024
a82f4be
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 9, 2024
d266bbf
fixed project apis
amandal-cn Sep 9, 2024
cd1105b
fixed workspace
amandal-cn Sep 9, 2024
90ed99b
added apis for artifacts
amandal-cn Sep 9, 2024
21f5d16
fixed publishing of artifacts
amandal-cn Sep 9, 2024
8ef7460
added capability to stream message
amandal-cn Sep 9, 2024
701f44b
added status field to each artifact
amandal-cn Sep 9, 2024
649a664
added parsing of code, dependencies and name
amandal-cn Sep 9, 2024
2e914a6
fixed render issue
amandal-cn Sep 9, 2024
5256e1e
fixed the rerendering issue in code editor
amandal-cn Sep 9, 2024
568f463
fixed re-rendering issue in the code editor
amandal-cn Sep 9, 2024
31e2962
fixed the status message rendering
amandal-cn Sep 9, 2024
068c558
added key
amandal-cn Sep 10, 2024
6873299
fixed the height issue of the workspace
amandal-cn Sep 10, 2024
2e18349
fixed rendering of messages
amandal-cn Sep 10, 2024
cbae231
added remark-gfm
amandal-cn Sep 10, 2024
198faeb
chat session updates on chaning artifact
amandal-cn Sep 10, 2024
de30b9c
disabled pinning of selected artifact
amandal-cn Sep 10, 2024
1e03252
improved the rendering of chat history
amandal-cn Sep 10, 2024
ee266d4
added code viewer capability
amandal-cn Sep 10, 2024
ebd3d2e
minimized delay in artifaction generation
amandal-cn Sep 10, 2024
8e043ed
removed unnecessary code
amandal-cn Sep 10, 2024
d928f7b
Add share modal
aprusty-cn Sep 10, 2024
af3d662
removed user since we will be using autho0 user
amandal-cn Sep 10, 2024
5882165
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 10, 2024
da0dc39
fixed build and eslint issues
amandal-cn Sep 10, 2024
2b6d44a
Share with user
aprusty-cn Sep 10, 2024
36d4a76
fixed code editor rendering issues
amandal-cn Sep 10, 2024
c8f80a5
minor fix
amandal-cn Sep 10, 2024
7ed046a
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 10, 2024
0703803
fixed code viewer and code editor
amandal-cn Sep 10, 2024
2cd55f9
fixed workspace
amandal-cn Sep 10, 2024
e6a6737
reduced delay between code and rendering
amandal-cn Sep 10, 2024
3a924ca
minimized latency in code rendering
amandal-cn Sep 10, 2024
7c57788
fixed artifacts list
amandal-cn Sep 10, 2024
5141e0b
delete with custom confirmation dialog
amandal-cn Sep 10, 2024
eb4604a
showing confirmation dialog at the center
amandal-cn Sep 10, 2024
7b3dcd9
fixed width of artifact name
amandal-cn Sep 10, 2024
6d10136
showing artifact info on hovering over artifact
amandal-cn Sep 10, 2024
db7ba96
fixed the styling of confirmation dialog
amandal-cn Sep 10, 2024
1942b3c
fixed status icon for artifacts
amandal-cn Sep 10, 2024
f42885c
fixed the menu for artifacts
amandal-cn Sep 10, 2024
c1184b2
added alert
amandal-cn Sep 10, 2024
d50b6b1
temporarily disabled tools
amandal-cn Sep 10, 2024
e5d1aff
fixed the styling for alert
amandal-cn Sep 10, 2024
588f580
fixed rerendering issues for artifacts with error
amandal-cn Sep 10, 2024
aed3a4d
fixed rendering issue
amandal-cn Sep 10, 2024
f1278de
fixed the duplicate issue
amandal-cn Sep 10, 2024
32e0585
added reset button
amandal-cn Sep 10, 2024
902a822
fixed reset button issues
amandal-cn Sep 11, 2024
f6b1b96
fixed refresh button
amandal-cn Sep 11, 2024
fd91503
combined update for project and selected artifact
amandal-cn Sep 11, 2024
0e2016a
capability to take attachments
amandal-cn Sep 11, 2024
262c66c
separated static configs
amandal-cn Sep 11, 2024
ec46897
fixed initial message rendering issue
amandal-cn Sep 11, 2024
2806a63
remove the local attachments on loading the artifacts
amandal-cn Sep 11, 2024
ef04b12
refactored processing of chat history
amandal-cn Sep 11, 2024
e8324a4
added capability to update artifacts
amandal-cn Sep 11, 2024
9951075
fixed required libraries issue
amandal-cn Sep 11, 2024
a2c8ac0
put restriction on the type of supported files
amandal-cn Sep 11, 2024
35c8207
Users with access list
aprusty-cn Sep 10, 2024
fdc6dd7
Access list edit access
aprusty-cn Sep 11, 2024
5a02022
added capability to compose
amandal-cn Sep 11, 2024
9c75aad
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 11, 2024
9183ae0
Add access level checks for workspace
trunapushpa Sep 11, 2024
e3e7ec9
Restrict access for shared projects
trunapushpa Sep 11, 2024
5154e64
Share based on current access level
trunapushpa Sep 11, 2024
5dc0cb3
Remove extra
aprusty-cn Sep 11, 2024
c83bdb7
Add share functionality to the dashboard
aprusty-cn Sep 11, 2024
40d657f
added auto fix button and status tracking for each artifact
amandal-cn Sep 11, 2024
f8a5090
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 11, 2024
06e165c
fixed sharing
amandal-cn Sep 11, 2024
ff14bf8
fixed the progress bar in the landing page
amandal-cn Sep 11, 2024
6bbaf8e
added loading message for dashboard
amandal-cn Sep 11, 2024
05220fc
Change createby
aprusty-cn Sep 11, 2024
459bc29
improved dashboard
amandal-cn Sep 11, 2024
1436034
Show contributors
aprusty-cn Sep 11, 2024
c3d73ba
fixed the styling for dashboard and projects
amandal-cn Sep 11, 2024
0f04957
Merge branch 'feat/project' of github-amandal-cn:trilogy-group/llamac…
amandal-cn Sep 11, 2024
e188a96
fixed build issues
amandal-cn Sep 11, 2024
dcef597
fixed issue with passing empty available components
amandal-cn Sep 11, 2024
d9abffd
fixed code gen issues
amandal-cn Sep 11, 2024
a3e7564
fixed api url issue
amandal-cn Sep 11, 2024
3ef42fd
added support for multiple models and warning for incomplete code
amandal-cn Sep 12, 2024
84222ad
added instruction for sticking to using fetch for api calls
amandal-cn Sep 12, 2024
b3bc98d
Feat/versioning (#17)
rishabh-ti Sep 12, 2024
fda1ebb
Remove explicit maxTokens in gpt4o
rishabh-ti Sep 13, 2024
268c079
Add Posthog (#19)
rishabh-ti Sep 13, 2024
9d8309f
fixed the header
amandal-cn Sep 13, 2024
f5160de
improved the project header
amandal-cn Sep 13, 2024
083fa21
added button to go to dashboard
amandal-cn Sep 13, 2024
a6c2a4d
enabled sharing functionality
amandal-cn Sep 13, 2024
0eda59f
enabled copy button
amandal-cn Sep 13, 2024
67c12f5
updated dependencies
amandal-cn Sep 13, 2024
3ae9441
fixed project header
amandal-cn Sep 13, 2024
c513b70
fixed infinite fga calls
amandal-cn Sep 14, 2024
bcf8165
customized view based on access level
amandal-cn Sep 14, 2024
a970f16
improved the look for edit access model
amandal-cn Sep 14, 2024
d790a66
improved the look for share modal
amandal-cn Sep 14, 2024
d304b90
added capability to publish
amandal-cn Sep 14, 2024
8857be5
fixed status icon for published artifacts
amandal-cn Sep 14, 2024
14630e1
remove temp dir
amandal-cn Sep 14, 2024
4d6bf37
added support for more text files and images
amandal-cn Sep 14, 2024
cb93140
added support for pdf-js
amandal-cn Sep 14, 2024
100388c
support for amr64
amandal-cn Sep 14, 2024
96d9180
added support for docx
amandal-cn Sep 14, 2024
879c6d9
Added api documentation (#21)
amandal-cn Sep 17, 2024
28a6dcd
Adding pipeline
aprusty-cn Sep 17, 2024
8d9307b
Update readme
aprusty-cn Sep 17, 2024
c2ac207
Use Authorization in swagger
rishabh-ti Sep 18, 2024
c7fd4a9
fixed issue where on empty projects it goes into loop
amandal-cn Sep 18, 2024
34ee9a9
Fix swagger page
aprusty-cn Sep 18, 2024
e79f1af
Cleanup
aprusty-cn Sep 18, 2024
9345c2d
Feat/migrate okta fga (#20)
rishabh-ti Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added workspace
amandal-cn committed Sep 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d8505ba56f28bfb8f1ce935a9d31197efbdec45a
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -37,4 +37,4 @@ yarn-error.log*
next-env.d.ts

node_modules
temp
temp/
245 changes: 245 additions & 0 deletions app/(main)/dummy-projects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
import { Project } from "@/types/Project";
import { Artifact } from "@/types/Artifact";

const createDummyArtifact = (name: string): Artifact => ({
id: Math.random().toString(36).substr(2, 9),
createdAt: new Date(),
updatedAt: new Date(),
name,
prompt: "Dummy prompt",
code: "console.log('Hello, World!');",
dependencies: {},
template: "default",
});


export const dummyProjects: Project[] = [
{
id: "1",
title: "AI Chatbot",
description:
"An intelligent chatbot powered by machine learning algorithms.",
context: [],
artifacts: [createDummyArtifact("Main"), createDummyArtifact("Utils")],
entrypoint: createDummyArtifact("Main"),
createdAt: new Date("2023-01-15"),
updatedAt: new Date("2023-04-20"),
createdBy: "user1",
updatedBy: "user1",
publishedUrl: "https://ai-chatbot.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1531746790731-6c087fecd65a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "2",
title: "Image Recognition App",
description:
"A mobile app that can identify objects in photos using computer vision.",
context: [],
artifacts: [
createDummyArtifact("ImageProcessor"),
createDummyArtifact("UI"),
],
entrypoint: createDummyArtifact("UI"),
createdAt: new Date("2023-02-28"),
updatedAt: new Date("2023-05-10"),
createdBy: "user2",
updatedBy: "user2",
publishedUrl: "",
status: "In Development",
thumbnail:
"https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "3",
title: "Data Visualization Tool",
description:
"An interactive web application for creating stunning data visualizations.",
context: [],
artifacts: [
createDummyArtifact("DataLoader"),
createDummyArtifact("Visualizer"),
],
entrypoint: createDummyArtifact("Visualizer"),
createdAt: new Date("2023-03-10"),
updatedAt: new Date("2023-05-15"),
createdBy: "user3",
updatedBy: "user3",
publishedUrl: "https://data-viz-tool.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "1",
title: "AI Chatbot",
description:
"An intelligent chatbot powered by machine learning algorithms.",
context: [],
artifacts: [createDummyArtifact("Main"), createDummyArtifact("Utils")],
entrypoint: createDummyArtifact("Main"),
createdAt: new Date("2023-01-15"),
updatedAt: new Date("2023-04-20"),
createdBy: "user1",
updatedBy: "user1",
publishedUrl: "https://ai-chatbot.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1531746790731-6c087fecd65a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "2",
title: "Image Recognition App",
description:
"A mobile app that can identify objects in photos using computer vision.",
context: [],
artifacts: [
createDummyArtifact("ImageProcessor"),
createDummyArtifact("UI"),
],
entrypoint: createDummyArtifact("UI"),
createdAt: new Date("2023-02-28"),
updatedAt: new Date("2023-05-10"),
createdBy: "user2",
updatedBy: "user2",
publishedUrl: "",
status: "In Development",
thumbnail:
"https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "3",
title: "Data Visualization Tool",
description:
"An interactive web application for creating stunning data visualizations.",
context: [],
artifacts: [
createDummyArtifact("DataLoader"),
createDummyArtifact("Visualizer"),
],
entrypoint: createDummyArtifact("Visualizer"),
createdAt: new Date("2023-03-10"),
updatedAt: new Date("2023-05-15"),
createdBy: "user3",
updatedBy: "user3",
publishedUrl: "https://data-viz-tool.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "1",
title: "AI Chatbot",
description:
"An intelligent chatbot powered by machine learning algorithms.",
context: [],
artifacts: [createDummyArtifact("Main"), createDummyArtifact("Utils")],
entrypoint: createDummyArtifact("Main"),
createdAt: new Date("2023-01-15"),
updatedAt: new Date("2023-04-20"),
createdBy: "user1",
updatedBy: "user1",
publishedUrl: "https://ai-chatbot.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1531746790731-6c087fecd65a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "2",
title: "Image Recognition App",
description:
"A mobile app that can identify objects in photos using computer vision.",
context: [],
artifacts: [
createDummyArtifact("ImageProcessor"),
createDummyArtifact("UI"),
],
entrypoint: createDummyArtifact("UI"),
createdAt: new Date("2023-02-28"),
updatedAt: new Date("2023-05-10"),
createdBy: "user2",
updatedBy: "user2",
publishedUrl: "",
status: "In Development",
thumbnail:
"https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "3",
title: "Data Visualization Tool",
description:
"An interactive web application for creating stunning data visualizations.",
context: [],
artifacts: [
createDummyArtifact("DataLoader"),
createDummyArtifact("Visualizer"),
],
entrypoint: createDummyArtifact("Visualizer"),
createdAt: new Date("2023-03-10"),
updatedAt: new Date("2023-05-15"),
createdBy: "user3",
updatedBy: "user3",
publishedUrl: "https://data-viz-tool.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "1",
title: "AI Chatbot",
description:
"An intelligent chatbot powered by machine learning algorithms.",
context: [],
artifacts: [createDummyArtifact("Main"), createDummyArtifact("Utils")],
entrypoint: createDummyArtifact("Main"),
createdAt: new Date("2023-01-15"),
updatedAt: new Date("2023-04-20"),
createdBy: "user1",
updatedBy: "user1",
publishedUrl: "https://ai-chatbot.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1531746790731-6c087fecd65a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "2",
title: "Image Recognition App",
description:
"A mobile app that can identify objects in photos using computer vision.",
context: [],
artifacts: [
createDummyArtifact("ImageProcessor"),
createDummyArtifact("UI"),
],
entrypoint: createDummyArtifact("UI"),
createdAt: new Date("2023-02-28"),
updatedAt: new Date("2023-05-10"),
createdBy: "user2",
updatedBy: "user2",
publishedUrl: "",
status: "In Development",
thumbnail:
"https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
{
id: "3",
title: "Data Visualization Tool",
description:
"An interactive web application for creating stunning data visualizations.",
context: [],
artifacts: [
createDummyArtifact("DataLoader"),
createDummyArtifact("Visualizer"),
],
entrypoint: createDummyArtifact("Visualizer"),
createdAt: new Date("2023-03-10"),
updatedAt: new Date("2023-05-15"),
createdBy: "user3",
updatedBy: "user3",
publishedUrl: "https://data-viz-tool.example.com",
status: "Active",
thumbnail:
"https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
},
];
35 changes: 35 additions & 0 deletions app/(main)/workspace.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useState } from "react";
import Header from "@/components/Header";
import ProjectList from "@/components/ProjectList";
import CreateProjectButton from "@/components/CreateProjectButton";
import ProjectOverviewInputForm from "@/components/ProjectOverviewInputForm";
import { Project } from "@/types/Project";
import EmptyProjectMessage from "@/components/EmptyProjectMessage";
import { dummyProjects } from "./dummy-projects";
import HeaderV2 from "@/components/HeaderV2";
import WorkspaceHeader from "@/components/WorkspaceHeader";

// const dummyProjects: Project[] = [];

const Dashboard: React.FC = () => {
const [showCreateForm, setShowCreateForm] = useState(false);

const handleCreateProject = () => setShowCreateForm(true);
const handleCancelCreate = () => setShowCreateForm(false);

const handleNextCreate = (description: string) => {
console.log("New project description:", description);
setShowCreateForm(false);
};

return (
<div className="flex min-h-screen flex-col">
<HeaderV2 />
{/* <WorkspaceHeader project={dummyProjects[1]} /> */}
<main className="flex-1 w-full mt-16">
</main>
</div>
);
};

export default Dashboard;
59 changes: 43 additions & 16 deletions components/HeaderV2.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,58 @@
import React from 'react';
import Image from 'next/image';
import Link from 'next/link';
import React from "react";
import Image from "next/image";
import Link from "next/link";
import logo from "../public/logo.png";

const HeaderV2: React.FC = () => {

return (
<header className="fixed top-0 left-0 right-0 z-50 bg-gray-50 shadow-sm">
<header className="fixed left-0 right-0 top-0 z-50 bg-gray-50 shadow-sm">
<div className="w-full">
<div className="flex items-center justify-between h-16 px-4">
<div className="flex h-16 items-center justify-between px-4">
<div className="flex items-center space-x-4">
<button className="text-gray-600 hover:bg-gray-200 p-1 rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
<button className="rounded-full p-1 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<Image src={logo} alt="Loom Logo" width={24} height={24} />
<h1 className="text-lg font-normal text-gray-800">Library | Loom - 3 September 2024</h1>
<Image src={logo} alt="Artifact Logo" width={24} height={24} />
<h1 className="text-xl tracking-tight">
Ar<span className="text-blue-600">TI</span>facts
</h1>
</div>
<div className="flex items-center space-x-6">
<button className="text-gray-600 hover:bg-gray-200 p-2 rounded-full relative">
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
<button className="relative rounded-full p-2 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
/>
</svg>
<span className="absolute top-1 right-1 h-2 w-2 bg-red-500 rounded-full"></span>
<span className="absolute right-1 top-1 h-2 w-2 rounded-full bg-red-500"></span>
</button>
<Link href="/" className="text-gray-600">
<span className="bg-blue-600 text-white rounded-full w-8 h-8 flex items-center justify-center text-sm font-semibold">A</span>
<span className={`bg-green-600 flex h-8 w-8 items-center justify-center rounded-full text-sm font-semibold text-white`}>
A
</span>
</Link>
</div>
</div>
@@ -34,4 +61,4 @@ const HeaderV2: React.FC = () => {
);
};

export default HeaderV2;
export default HeaderV2;
17 changes: 15 additions & 2 deletions components/ProjectOverview.tsx
Original file line number Diff line number Diff line change
@@ -11,6 +11,18 @@ const ProjectOverview: React.FC<ProjectOverviewProps> = ({ project }) => {
// Mock tags - replace with actual project tags when available
const mockTags = ['React', 'TypeScript', 'AI', 'Mobile'];
const projectTags = mockTags.slice(0, Math.floor(Math.random() * 3) + 1);
const contributors = [1, 2, 3];

// Function to generate a color based on the createdBy string
const getColorFromString = (str: string) => {
const colors =[ 'red', 'green', "yellow"];
const hash = str.split('').reduce((acc, char) => char.charCodeAt(0) + acc, 0);
console.log(hash);
console.log(colors[hash % colors.length], project.createdBy);
return colors[hash % colors.length];
};

const projectColor = getColorFromString(project.createdBy);

return (
<div className="bg-white/60 backdrop-blur-md rounded-xl shadow-sm p-4 transition-all duration-300 hover:shadow-md hover:translate-y-[-2px] bg-gradient-to-br from-blue-50/80 to-white/70">
@@ -27,13 +39,14 @@ const ProjectOverview: React.FC<ProjectOverviewProps> = ({ project }) => {

<div className="flex items-center justify-between mb-2">
<div className="flex items-center flex-grow">
<div className="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center text-white font-medium text-sm mr-3">
<div className={`w-8 h-8 bg-${projectColor}-500 rounded-full flex items-center justify-center text-white font-medium text-sm mr-3`}>
{project.createdBy[0].toUpperCase()}
</div>
<div>
<h3 className="text-lg font-semibold text-gray-800">{project.title}</h3>
<p className="text-xs text-gray-500">
{project.createdBy} · {project.createdAt.toLocaleDateString()}
{project.updatedBy} · {project.updatedAt.toLocaleDateString()} ·
<span className="ml-1 font-medium">{contributors.length} contributor{contributors.length !== 1 ? 's' : ''}</span>
</p>
</div>
</div>
132 changes: 132 additions & 0 deletions components/WorkspaceHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import React from "react";
import logo from "../public/logo.png";
import Image from "next/image";
import Link from "next/link";
import { Project } from "@/types/Project";

type WorkspaceHeaderProps = {
project: Project;
}

const WorkspaceHeader: React.FC<WorkspaceHeaderProps> = ({ project }) => {
return (
<header className="fixed left-0 right-0 top-0 z-50 bg-gray-50 shadow-sm">
<div className="w-full">
<div className="flex h-16 items-center justify-between px-4">
<div className="flex items-center space-x-4">
<button className="rounded-full p-1 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<Image src={logo} alt="Artifact Logo" width={24} height={24} />
<h1 className="text-lg font-normal text-gray-800">
{project.title}
</h1>
</div>
<div className="flex items-center space-x-6">
<span className="text-sm text-gray-600">0 views</span>
<button className="flex items-center space-x-1 rounded-full bg-blue-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-blue-700">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-4 w-4"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"
/>
</svg>
<span>Share</span>
</button>
<button className="rounded-full p-2 text-blue-600 hover:bg-blue-100">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
/>
</svg>
</button>
<button className="rounded-full p-2 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
/>
</svg>
</button>
<button className="relative rounded-full p-2 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
/>
</svg>
<span className="absolute right-1 top-1 h-2 w-2 rounded-full bg-red-500"></span>
</button>
<button className="rounded-full p-2 text-gray-600 hover:bg-gray-200">
<svg
xmlns="http://www.w3.org/2000/svg"
className="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"
/>
</svg>
</button>
<Link href="/profile" className="text-gray-600">
<span className="flex h-8 w-8 items-center justify-center rounded-full bg-blue-600 text-sm font-semibold text-white"></span>
</Link>
</div>
</div>
</div>
</header>
);
};

export default WorkspaceHeader;