diff --git a/packages/documentation/src/Components/Table.stories.tsx b/packages/documentation/src/Components/Table.stories.tsx index 3fa4d1f8..48dbafdc 100644 --- a/packages/documentation/src/Components/Table.stories.tsx +++ b/packages/documentation/src/Components/Table.stories.tsx @@ -34,12 +34,28 @@ export default { }, }; +const data = [ + { + id: 1, + character: "Paul Atreides", + actor: "Timothée Chalamet", + timestamp: "10/16/2023 08:46 PM EDT", + }, + { + id: 2, + character: "Lady Jessica", + actor: "Rebecca Ferguson", + timestamp: "10/16/2023 08:55 PM EDT", + }, + { + id: 3, + character: "Duncan Idaho", + actor: "Jason Momoa", + timestamp: "10/16/2023 08:59 PM EDT", + }, +]; + export const Basic: Story = (args) => { - const data = [ - { id: 1, character: "Paul Atreides", actor: "Timothée Chalamet" }, - { id: 2, character: "Lady Jessica", actor: "Rebecca Ferguson" }, - { id: 3, character: "Duncan Idaho", actor: "Jason Momoa" }, - ]; return (
@@ -66,27 +82,6 @@ export const Basic: Story = (args) => { }; export const WithAction: Story = (args) => { - const data = [ - { - id: 1, - timestamp: "10/16/2023 08:46 PM EDT", - character: "Who plays Paul Atreides?", - actor: "Timothée Chalamet", - }, - { - id: 2, - timestamp: "10/16/2023 08:55 PM EDT", - character: "What about Lady Jessica?", - actor: "Rebecca Ferguson", - }, - { - id: 3, - timestamp: "10/16/2023 08:59 PM EDT", - character: "And Duncan Idaho?", - actor: "Jason Momoa", - }, - ]; - return (
@@ -145,7 +140,7 @@ export const WithAction: Story = (args) => { }; export const Sticky: Story = (args) => { - const data = [ + const extraData = [ { id: 1, timestamp: "10/16/2023 08:46 PM EDT", @@ -205,7 +200,7 @@ export const Sticky: Story = (args) => { - {data.map((row, idx) => { + {extraData.map((row, idx) => { return ( @@ -235,3 +230,31 @@ Sticky.args = { stickyFooter: true, maxHeight: "260px", }; + +export const WithRowNumbers: Story = (args) => { + return ( +
+
+ + + + Row + Character + Actor + + + + + {data.map((row, idx) => ( + + {idx + 1} + {row.character} + {row.actor} + + ))} + +
+
+
+ ); +};