@@ -4,7 +4,7 @@ import { useAccount } from "../../components/context-account"
44import { useWorkspace } from "../components/context-workspace"
55import { Button } from "../../ui/button"
66import Layout from "./components/Layout"
7- import { For , createSignal } from "solid-js"
7+ import { For } from "solid-js"
88import style from "./integrations.module.css"
99
1010export default function Integrations ( ) {
@@ -15,15 +15,11 @@ export default function Integrations() {
1515 return zero . query . aws_account . where ( "workspace_id" , workspace . id )
1616 } )
1717
18- // Dummy data for demonstration
19- const [ dummyAccounts , setDummyAccounts ] = createSignal ( [
20- { id : "1" , account_number : "123456789012" , region : "us-east-1" } ,
21- { id : "2" , account_number : "098765432109" , region : "us-west-2" } ,
22- ] )
23-
24- const handleRemoveAccount = ( id : string ) => {
18+ const handleRemoveAccount = async ( id : string ) => {
2519 console . log ( `Removing account ${ id } ` )
26- setDummyAccounts ( prev => prev . filter ( acc => acc . id !== id ) )
20+ // In a real implementation, this would call a mutation to set time_deleted
21+ // For now, just log the action
22+ // await zero.mutate.aws_account.update(workspace.id, id, { time_deleted: Date.now() })
2723 }
2824
2925 const handleConnectAWS = ( ) => {
@@ -32,6 +28,9 @@ export default function Integrations() {
3228 )
3329 }
3430
31+ // Filter out soft-deleted accounts
32+ const activeAccounts = ( ) => awsAccounts ( ) ?. filter ( account => ! account . time_deleted ) || [ ]
33+
3534 return (
3635 < Layout >
3736 < div data-component = "title-bar" >
@@ -47,7 +46,7 @@ export default function Integrations() {
4746 < p > Connect your AWS accounts.</ p >
4847 </ div >
4948
50- { dummyAccounts ( ) . length === 0 ? (
49+ { activeAccounts ( ) . length === 0 ? (
5150 < div data-slot = "empty-state" >
5251 < p > Connect your AWS account to get started.</ p >
5352 < Button color = "primary" onClick = { handleConnectAWS } >
@@ -56,7 +55,7 @@ export default function Integrations() {
5655 </ div >
5756 ) : (
5857 < div data-slot = "list" >
59- < For each = { dummyAccounts ( ) } >
58+ < For each = { activeAccounts ( ) } >
6059 { ( account ) => (
6160 < div data-slot = "item" >
6261 < div data-slot = "account" >
0 commit comments