Skip to content

Commit

Permalink
feat: move the display change as a new component
Browse files Browse the repository at this point in the history
  • Loading branch information
Melichka committed Sep 2, 2024
1 parent 3c11f12 commit 48ac0e5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react"

import ViewListIcon from "@mui/icons-material/ViewList"
import ViewModuleIcon from "@mui/icons-material/ViewModule"
import { IconButton } from "@mui/material"

interface ViewModeToggleProps {
viewMode: "list" | "grid"
onToggleViewMode: () => void
}

export const ViewModeToggle: React.FC<ViewModeToggleProps> = ({ viewMode, onToggleViewMode }) => {
return (
<div>
<IconButton onClick={onToggleViewMode}>
{viewMode === "list" ? <ViewModuleIcon /> : <ViewListIcon />}
</IconButton>
</div>
)
}

export default ViewModeToggle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ViewModeToggle } from "./ViewModeToggle"

0 comments on commit 48ac0e5

Please sign in to comment.