mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2026-01-15 12:15:02 +00:00
Also add Shortcut to type returns
This commit is contained in:
@@ -20,10 +20,9 @@ type ColumnDataProps = {
|
||||
const ColumnRow: FC<{
|
||||
columns: Columns;
|
||||
isDirectory: boolean;
|
||||
isShortcut: boolean;
|
||||
path: string;
|
||||
stats: Stats;
|
||||
}> = ({ columns, isDirectory, isShortcut, path, stats }) => {
|
||||
}> = ({ columns, isDirectory, path, stats }) => {
|
||||
const { stat } = useFileSystem();
|
||||
const { formats } = useTheme();
|
||||
const getColumnData = useCallback(async (): Promise<ColumnDataProps> => {
|
||||
@@ -32,13 +31,9 @@ const ColumnRow: FC<{
|
||||
return {
|
||||
date: getDateModified(path, fullStats, formats.dateModified),
|
||||
size: isDirectory ? "" : getFormattedSize(fullStats.size, true),
|
||||
type: isDirectory
|
||||
? "File folder"
|
||||
: isShortcut
|
||||
? "Shortcut"
|
||||
: getFileType(getExtension(path)),
|
||||
type: isDirectory ? "File folder" : getFileType(getExtension(path)),
|
||||
};
|
||||
}, [formats.dateModified, isDirectory, isShortcut, path, stat, stats]);
|
||||
}, [formats.dateModified, isDirectory, path, stat, stats]);
|
||||
const [columnData, setColumnData] = useState<ColumnDataProps>();
|
||||
const creatingRef = useRef(false);
|
||||
|
||||
|
||||
@@ -905,6 +905,8 @@ export const getFileType = (extension: string): string => {
|
||||
const ext = extension.toUpperCase();
|
||||
|
||||
switch (ext) {
|
||||
case SHORTCUT_EXTENSION:
|
||||
return "Shortcut";
|
||||
case ".TXT":
|
||||
return "Text Document";
|
||||
case ".RTF":
|
||||
|
||||
@@ -628,7 +628,6 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||
<ColumnRow
|
||||
columns={columns}
|
||||
isDirectory={isDirectory}
|
||||
isShortcut={isShortcut}
|
||||
path={path}
|
||||
stats={stats}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user