Skip to content

Commit

Permalink
chore: used optional chain expression
Browse files Browse the repository at this point in the history
  • Loading branch information
princerajpoot20 committed Oct 3, 2023
1 parent 9f5e5dc commit 661c9cb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions modelina-website/src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ export default function CodeBlock({
}: any) {
const [activeBlock, setActiveBlock] = useState(0);
const [showIsCopied, setShowIsCopied] = useState(false);
codeBlocks =
codeBlocks && codeBlocks.length
? codeBlocks
: [{ code: children.replace(/\n$/, '') }];
codeBlocks = codeBlocks?.length ? codeBlocks : [{ code: children.replace(/\n$/, '') }];

const tabItemsCommonClassNames =
'inline-block border-teal-300 py-1 px-2 mx-px cursor-pointer hover:text-teal-300 font-bold';
Expand Down

0 comments on commit 661c9cb

Please sign in to comment.