File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
site/components/CodeBlock Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { Story } from "@storybook/react"
2
+ import React from "react"
3
+ import { CodeBlock , CodeBlockProps } from "./index"
4
+
5
+ const sampleLines = `Successfully assigned coder/image-jcws7 to gke-master-workspaces-1-ef039342-cybd
6
+ Container image "gcr.io/coder-dogfood/master/coder-dev-ubuntu@sha256:80604e432c039daf558edfd7c01b9ea1f62f9c4b0f30aeab954efe11c404f8ee" already present on machine
7
+ Created container user
8
+ Started container user
9
+ Using user 'coder' with shell '/bin/bash'` . split ( '\n' )
10
+
11
+ export default {
12
+ title : "CodeBlock" ,
13
+ component : CodeBlockProps ,
14
+ argTypes : {
15
+ lines : { control : "object" , defaultValue : sampleLines } ,
16
+ } ,
17
+ }
18
+
19
+ const Template : Story < CodeBlockProps > = ( args ) => < CodeBlock { ...args } />
20
+
21
+ export const Example = Template . bind ( { } )
22
+ Example . args = {
23
+ lines : sampleLines ,
24
+ }
Original file line number Diff line number Diff line change 1
1
import { makeStyles } from "@material-ui/core/styles"
2
2
import React from "react"
3
3
4
- interface Props {
4
+ interface CodeBlockProps {
5
5
lines : string [ ]
6
6
}
7
7
8
- export const CodeBlock : React . FC < Props > = ( { lines } ) => {
8
+ export const CodeBlock : React . FC < CodeBlockProps > = ( { lines } ) => {
9
9
const styles = useStyles ( )
10
10
11
11
return (
You can’t perform that action at this time.
0 commit comments