xcv58/Tab-Manager-v2

View on GitHub
packages/extension/src/js/components/Shortcut/Shortcuts.tsx

Summary

Maintainability
A
30 mins
Test Coverage
import React from 'react'
 
const Shortcuts = ({ shortcut }: { shortcut: string | string[] }) => {
if (!Array.isArray(shortcut)) {
return (
<kbd className="px-2 py-1 mx-1 text-sm leading-loose tracking-widest text-white bg-blue-500 rounded">
{shortcut}
</kbd>
)
}
Similar blocks of code found in 2 locations. Consider refactoring.
return (
<>
{shortcut.map((x) => (
<Shortcuts key={x} shortcut={x} />
))}
</>
)
}
 
export default Shortcuts