refactor: move studio to frontends workspace
- Move studio from root to frontends/studio/ - Add owner-tools frontend for live blog admin UI - Add shared ui component library - Set up npm workspaces for frontends - Add enhanced code block extension for editor Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c662e41b97
commit
bef5dd4437
108 changed files with 8650 additions and 441 deletions
19
frontends/studio/src/stores/app.ts
Normal file
19
frontends/studio/src/stores/app.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { atom } from 'nanostores'
|
||||
|
||||
export interface Toast {
|
||||
id: string
|
||||
message: string
|
||||
type: 'success' | 'error'
|
||||
}
|
||||
|
||||
export const $toasts = atom<Toast[]>([])
|
||||
|
||||
export const addToast = (message: string, type: 'success' | 'error' = 'success') => {
|
||||
const id = Math.random().toString(36).slice(2)
|
||||
$toasts.set([...$toasts.get(), { id, message, type }])
|
||||
setTimeout(() => removeToast(id), 4000)
|
||||
}
|
||||
|
||||
export const removeToast = (id: string) => {
|
||||
$toasts.set($toasts.get().filter(t => t.id !== id))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue