Skip to content

Commit

Permalink
Refactor props-table component to use TypeScript
Browse files Browse the repository at this point in the history
interfaces
  • Loading branch information
mhnpd committed Dec 18, 2023
1 parent 1b9d9de commit a7e23af
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/src/components/props-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import React, { ReactElement } from 'react'
import Table from 'rc-table'
import { sortBy } from 'lodash'

type Properties = {
name: string
type: string
default: string
}

type Props = {
properties: [
{
name: string
type: string
},
]
properties: Properties[]
}

const columns = [
Expand All @@ -23,14 +24,14 @@ const columns = [
dataIndex: 'type',
key: 'type',
width: 150,
render: (_, row) => (<em style={{ color: '#932981' }}>{row.type}</em>)
render: (_:unknown, row:Properties) => (<em style={{ color: '#932981' }}>{row.type}</em>)
},
{
title: 'Default',
dataIndex: 'default',
key: 'default',
width: 250,
render: (_, row) => (<code style={{ color: '#932981' }}>{row.default}</code>)
render: (_:unknown, row:Properties) => (<code style={{ color: '#932981' }}>{row.default}</code>)
},
{
title: 'Description',
Expand Down

0 comments on commit a7e23af

Please sign in to comment.