mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
25 lines
678 B
TypeScript
25 lines
678 B
TypeScript
import { ComponentMeta, Story } from "@storybook/react"
|
|
import React from "react"
|
|
import { TableRowMenu, TableRowMenuProps } from "./TableRowMenu"
|
|
|
|
export default {
|
|
title: "components/TableRowMenu",
|
|
component: TableRowMenu,
|
|
} as ComponentMeta<typeof TableRowMenu>
|
|
|
|
type DataType = {
|
|
id: string
|
|
}
|
|
|
|
const Template: Story<TableRowMenuProps<DataType>> = (args) => <TableRowMenu {...args} />
|
|
|
|
export const Example = Template.bind({})
|
|
Example.args = {
|
|
data: { id: "123" },
|
|
menuItems: [
|
|
{ label: "Suspend", onClick: (data) => alert(data.id) },
|
|
{ label: "Update", onClick: (data) => alert(data.id) },
|
|
{ label: "Delete", onClick: (data) => alert(data.id) },
|
|
],
|
|
}
|