mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-04 12:40:08 +00:00
further implementing server page (#4)
* further implementing server page * optimize icon button * rename some unnecessary file extensions * add terminal page & fm card
This commit is contained in:
42
src/components/xui/icon-button.tsx
Normal file
42
src/components/xui/icon-button.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Plus, Edit2, Trash2, Terminal, CircleArrowUp, Clipboard, Check, FolderClosed } from "lucide-react"
|
||||
import { Button, ButtonProps } from "@/components/ui/button"
|
||||
import { forwardRef } from "react";
|
||||
|
||||
export interface IconButtonProps extends ButtonProps {
|
||||
icon: "clipboard" | "check" | "edit" | "trash" | "plus" | "terminal" | "update" | "folder-closed";
|
||||
}
|
||||
|
||||
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, ref) => {
|
||||
return (
|
||||
<Button {...props} ref={ref} size="icon">
|
||||
{(() => {
|
||||
switch (props.icon) {
|
||||
case "clipboard": {
|
||||
return <Clipboard />;
|
||||
}
|
||||
case "check": {
|
||||
return <Check />;
|
||||
}
|
||||
case "edit": {
|
||||
return <Edit2 />;
|
||||
}
|
||||
case "trash": {
|
||||
return <Trash2 />;
|
||||
}
|
||||
case "plus": {
|
||||
return <Plus />;
|
||||
}
|
||||
case "terminal": {
|
||||
return <Terminal />;
|
||||
}
|
||||
case "update": {
|
||||
return <CircleArrowUp />;
|
||||
}
|
||||
case "folder-closed": {
|
||||
return <FolderClosed />;
|
||||
}
|
||||
}
|
||||
})()}
|
||||
</Button>
|
||||
);
|
||||
})
|
||||
Reference in New Issue
Block a user