MCPcopy
hub / github.com/primer/react / WithRowAction

Function WithRowAction

packages/react/src/DataTable/DataTable.features.stories.tsx:678–756  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676)
677
678export const WithRowAction = () => (
679 <Table.Container>
680 <Table.Title as="h2" id="repositories">
681 Repositories
682 </Table.Title>
683 <Table.Subtitle as="p" id="repositories-subtitle">
684 A subtitle could appear here to give extra context to the data.
685 </Table.Subtitle>
686 <DataTable
687 aria-labelledby="repositories"
688 aria-describedby="repositories-subtitle"
689 data={data}
690 columns={[
691 {
692 header: 'Repository',
693 field: 'name',
694 rowHeader: true,
695 },
696 {
697 header: 'Type',
698 field: 'type',
699 renderCell: row => {
700 return <Label>{uppercase(row.type)}</Label>
701 },
702 },
703 {
704 header: 'Updated',
705 field: 'updatedAt',
706 renderCell: row => {
707 return <RelativeTime date={new Date(row.updatedAt)} />
708 },
709 },
710 {
711 header: 'Dependabot',
712 field: 'securityFeatures.dependabot',
713 renderCell: row => {
714 return row.securityFeatures.dependabot.length > 0 ? (
715 <LabelGroup>
716 {row.securityFeatures.dependabot.map(feature => {
717 return <Label key={feature}>{uppercase(feature)}</Label>
718 })}
719 </LabelGroup>
720 ) : null
721 },
722 },
723 {
724 header: 'Code scanning',
725 field: 'securityFeatures.codeScanning',
726 renderCell: row => {
727 return row.securityFeatures.codeScanning.length > 0 ? (
728 <LabelGroup>
729 {row.securityFeatures.codeScanning.map(feature => {
730 return <Label key={feature}>{uppercase(feature)}</Label>
731 })}
732 </LabelGroup>
733 ) : null
734 },
735 },

Callers

nothing calls this directly

Calls 1

uppercaseFunction · 0.70

Tested by

no test coverage detected