Skip to content

Commit 4be4572

Browse files
committed
Missing frontend dependencies.
1 parent 398983b commit 4be4572

4 files changed

Lines changed: 40 additions & 1 deletion

File tree

frontend/.env.local

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DELETE FILE IF LOCALHOST IS RUNNING PERPENDICULARITY
2+
VITE_API_URL=http://<EC2 ADDRESS OF PERPENDICULARITY>:8000

frontend/src/api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* API client for Perpendicularity backend
33
*/
44

5+
// frontend/src/vite-env.d.ts
6+
/// <reference types="vite/client" />
7+
58
import type { Config, ChatRequest, SSEEvent } from './types'
69

710
const API_BASE = import.meta.env.VITE_API_URL ||

frontend/src/lib/utils.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { type ClassValue, clsx } from 'clsx'
2+
import { twMerge } from 'tailwind-merge'
3+
4+
/**
5+
* Merge Tailwind CSS classes with clsx
6+
*/
7+
export function cn(...inputs: ClassValue[]) {
8+
return twMerge(clsx(inputs))
9+
}
10+
11+
/**
12+
* Format date to readable string
13+
*/
14+
export function formatDate(date: Date): string {
15+
return new Intl.DateTimeFormat('en-US', {
16+
hour: 'numeric',
17+
minute: 'numeric',
18+
hour12: true,
19+
}).format(date)
20+
}
21+
22+
/**
23+
* Copy text to clipboard
24+
*/
25+
export async function copyToClipboard(text: string): Promise<boolean> {
26+
try {
27+
await navigator.clipboard.writeText(text)
28+
return true
29+
} catch (err) {
30+
console.error('Failed to copy:', err)
31+
return false
32+
}
33+
}

frontend/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"lib": ["ES2020", "DOM", "DOM.Iterable"],
66
"module": "ESNext",
77
"skipLibCheck": true,
8+
"types": ["vite/client"],
89

910
/* Bundler mode */
1011
"moduleResolution": "bundler",
@@ -26,6 +27,6 @@
2627
"@/*": ["./src/*"]
2728
}
2829
},
29-
"include": ["src"],
30+
"include": ["src", "src/vite-env.d.ts"],
3031
"references": [{ "path": "./tsconfig.node.json" }]
3132
}

0 commit comments

Comments
 (0)