diff --git a/fresh.gen.ts b/fresh.gen.ts index 0a3a05f..579fc83 100644 --- a/fresh.gen.ts +++ b/fresh.gen.ts @@ -8,6 +8,7 @@ import * as $api_joke from './routes/api/joke.ts' import * as $greet_name_ from './routes/greet/[name].tsx' import * as $index from './routes/index.tsx' import * as $Counter from './islands/Counter.tsx' +import * as $Dashboard from './islands/Dashboard.tsx' import { type Manifest } from '$fresh/server.ts' const manifest = { @@ -20,6 +21,7 @@ const manifest = { }, islands: { './islands/Counter.tsx': $Counter, + './islands/Dashboard.tsx': $Dashboard, }, baseUrl: import.meta.url, } satisfies Manifest diff --git a/islands/Dashboard.tsx b/islands/Dashboard.tsx new file mode 100644 index 0000000..25f9a93 --- /dev/null +++ b/islands/Dashboard.tsx @@ -0,0 +1,60 @@ +import { useSignal } from 'https://esm.sh/v135/@preact/signals@1.2.2/X-ZS8q/dist/signals.js' +import { JSX } from 'preact' + +// interface Budget { +// name: string +// target: number +// buffer?: number +// } + +interface IconButtonProps { + active?: boolean + text: string + icon: string +} +function IconButton( + { icon, text, active, ...props }: + & IconButtonProps + & JSX.HTMLAttributes, +) { + return ( + + ) +} + +export default function Dashboard() { + const activeNavItemIndex = useSignal(0) + const navItems = [ + { text: 'Some Text', icon: 'ICON' }, + { text: 'Some Text', icon: 'ICON' }, + { text: 'Some Text', icon: 'ICON' }, + ] + + return ( +
+
+ This is the main content +
+ + +
+ ) +} diff --git a/routes/index.tsx b/routes/index.tsx index 67be0d7..3f225bd 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -1,46 +1,5 @@ -import { VNode } from 'https://esm.sh/v128/preact@10.19.6/src/index.js' -import { JSX } from 'preact' - -interface Budget { - name: string - target: number - buffer?: number -} - -interface IconButtonProps { - text: string - icon: string -} - -function IconButton( - { icon, text, ...props }: - & IconButtonProps - & JSX.HTMLAttributes, -) { - return ( - - {icon} - {text} - - ) -} +import Dashboard from '../islands/Dashboard.tsx' export default function Home() { - return ( -
-
- This is the main content -
- - -
- ) + return }