Files
Joshen Lim 27e89ed64e Analytics bucket support creating bucket tables in dashboard (#40858)
* Midway

* Hook up create/delete table, and update all iceberg RQs with mgmt API routes

* Add insert data CTA, update create table logic for decimal and fixed types

* Clean up

* Nit

* Fix test
2025-12-02 22:17:13 +08:00

50 lines
1.5 KiB
TypeScript

import { noop } from 'lodash'
import { FormattedWrapperTable } from 'components/interfaces/Integrations/Wrappers/Wrappers.utils'
import {
ScaffoldHeader,
ScaffoldSectionDescription,
ScaffoldSectionTitle,
} from 'components/layouts/Scaffold'
import { HIDE_REPLICATION_USER_FLOW } from './AnalyticsBucketDetails.constants'
import { ConnectTablesDialog } from './ConnectTablesDialog'
import { CreateTableInstructionsDialog } from './CreateTable/CreateTableInstructionsDialog'
interface BucketHeaderProps {
showActions?: boolean
namespaces?: {
namespace: string
schema: string
tables: FormattedWrapperTable[]
}[]
onSuccessConnectTables?: () => void
}
export const BucketHeader = ({
showActions = true,
namespaces = [],
onSuccessConnectTables = noop,
}: BucketHeaderProps) => {
return (
<ScaffoldHeader className="pt-0 flex flex-row justify-between items-end gap-x-8">
<div>
<ScaffoldSectionTitle>Tables</ScaffoldSectionTitle>
<ScaffoldSectionDescription>
Analytics tables stored in this bucket
</ScaffoldSectionDescription>
</div>
{showActions && (
<div className="flex items-center gap-x-2">
{HIDE_REPLICATION_USER_FLOW ? (
<CreateTableInstructionsDialog />
) : (
namespaces.length > 0 && (
<ConnectTablesDialog onSuccessConnectTables={onSuccessConnectTables} />
)
)}
</div>
)}
</ScaffoldHeader>
)
}